-
Notifications
You must be signed in to change notification settings - Fork 792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix confirm_election_by_request
test
#3905
Fix confirm_election_by_request
test
#3905
Conversation
0d035bd
to
5421ad2
Compare
5421ad2
to
1fb5909
Compare
1fb5909
to
312c989
Compare
* 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) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this code is a duplicate. We already have system::delay_ms.
However, this implementation looks better. It should replace the implementation in delay_ms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup it's more ergonomic to use, just write WAIT(1s)
instead of system.delay_ms (std::chrono::milliseconds (1000));
{ | ||
i->stop (); | ||
} | ||
// Only stop system in destructor to avoid confusing and random bugs when debugging assertions that hit deadline expired condition |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change should really be in a different PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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.