refactor: Simplify duplicated simulation and improve test condition#118
Conversation
| }); | ||
| } | ||
| hash_set.len() | ||
| } |
There was a problem hiding this comment.
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.
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.
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.
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.
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.