-
Notifications
You must be signed in to change notification settings - Fork 14
refactor: Simplify duplicated simulation and improve test condition #118
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
Conversation
| }); | ||
| } | ||
| hash_set.len() | ||
| } |
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.
Is there a reason why the counting needs to be executed multiple times for 1 second, rather than just once after a 1-second delay?
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.
I use a loop because the tick interval is unpredictable, so repeatedly checking within the 2-second window ensures we capture all relevant state changes.
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.
tick_interval is fixed.
If you mean to election_tick, we can fix it using min_election_tick and max_election_tick.
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.
Currently, tick_interval is fixed in this test. We need to modify it to handle varying tick_interval values
6aa4c5f to
9fdfa85
Compare
harness/src/utils.rs
Outdated
| .expect("Failed to execute kill command"); | ||
| } | ||
|
|
||
| pub async fn collect_state_matching_rafts_until_leader_emerge( |
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.
I think collect_state_matching_rafts_until_leader_emerge is verbose and performs too many tasks.
I think it would be better to separate the functionality of returning rafts that match a specific state and waiting for a leader to emerge.
ef10415 to
64c0934
Compare
8abf1c8 to
926b404
Compare
95280e1 to
d466abb
Compare
…prove make test command
…rafts_when_leader_elected
fc5f7d3 to
99df4b1
Compare
Uh oh!
There was an error while loading. Please reload this page.