Skip to content

Commit

Permalink
Fixes to the failing test case - no longer ignored
Browse files Browse the repository at this point in the history
We need to *restart* election on all the partitioned followers (so that
each one of them increases term by 1) and then they can lead to election
`Finished` state.

This is what will happen in real world where the followers will
determine the leader is `Confirmed` and independently update their
*term* and start a new election.

Signed-off-by: Abhijit Gadgil <[email protected]>
  • Loading branch information
agadgil-progress committed Oct 7, 2024
1 parent f11fa06 commit 0223633
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions components/butterfly/tests/rumor/election.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ fn five_members_elect_a_new_leader_when_the_old_one_dies() {
});
}

#[ignore = "Leader Election Algorithm Changed. Need to revisit this test."]
#[test]
#[allow(clippy::cognitive_complexity)]
fn five_members_elect_a_new_leader_when_they_are_quorum_partitioned() {
Expand Down Expand Up @@ -132,7 +131,9 @@ fn five_members_elect_a_new_leader_when_they_are_quorum_partitioned() {
net.partition(0..2, 2..5);
assert_wait_for_health_of_mlr!(net, [0..2, 2..5], Health::Confirmed);
net[0].restart_elections_rsw_mlr_rhw_msr(FeatureFlag::empty());
// net[4].restart_elections_rsw_mlr_rhw_msr(FeatureFlag::empty());
net[2].restart_elections_rsw_mlr_rhw_msr(FeatureFlag::empty());
net[3].restart_elections_rsw_mlr_rhw_msr(FeatureFlag::empty());
net[4].restart_elections_rsw_mlr_rhw_msr(FeatureFlag::empty());
assert_wait_for_election_status!(net, 0, "witcher.prod", ElectionStatus::NoQuorum);
assert_wait_for_election_status!(net, 1, "witcher.prod", ElectionStatus::NoQuorum);
assert_wait_for_election_status!(net, 2, "witcher.prod", ElectionStatus::Finished);
Expand Down

0 comments on commit 0223633

Please sign in to comment.