Fix confirm_election_by_request test#3905
Merged
pwojcikdev merged 1 commit intonanocurrency:developfrom Aug 29, 2022
Merged
Conversation
0d035bd to
5421ad2
Compare
5421ad2 to
1fb5909
Compare
1fb5909 to
312c989
Compare
dsiganos
reviewed
Aug 29, 2022
| * Waits specified number of time while keeping system running. | ||
| * Useful for asserting conditions that should still hold after some delay of time | ||
| */ | ||
| #define WAIT(time) \ |
Contributor
There was a problem hiding this comment.
this code is a duplicate. We already have system::delay_ms.
However, this implementation looks better. It should replace the implementation in delay_ms.
Contributor
Author
There was a problem hiding this comment.
Yup it's more ergonomic to use, just write WAIT(1s) instead of system.delay_ms (std::chrono::milliseconds (1000));
dsiganos
reviewed
Aug 29, 2022
| { | ||
| i->stop (); | ||
| } | ||
| // Only stop system in destructor to avoid confusing and random bugs when debugging assertions that hit deadline expired condition |
Contributor
There was a problem hiding this comment.
This change should really be in a different PR.
Contributor
Author
There was a problem hiding this comment.
Probably should be, I just got annoyed at system stopping everything for no good reason and making it harder for me to debug things. It's a relatively small change though
dsiganos
approved these changes
Aug 29, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When testing election confirmations by requesting votes we don't want the other node to have the same election active, as in that case votes would be eagerly generated. Previously the election would get confirmed anyway, even if we didn't request any votes.