Skip to content

Commit

Permalink
Merge branch 'main' into build_check
Browse files Browse the repository at this point in the history
  • Loading branch information
achamayou authored Oct 24, 2023
2 parents d1d97ab + 6d4323d commit 1d46255
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/raft_scenarios/bad_network
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dispatch_all

periodic_all,10
dispatch_all
assert_is_primary,0

# An initial entry is written and successfully replicated
replicate,1,helloworld
Expand All @@ -35,10 +36,6 @@ periodic_all,10
drop_pending,0
dispatch_all

periodic_all,10
drop_pending,0
dispatch_all

# Before either follower times out, the message eventually reaches Node 1 (though not Node 2)
periodic_all,10
drop_pending_to,0,2
Expand All @@ -60,9 +57,11 @@ dispatch_all_once

# Eventually Node 2 is partitioned for so long that it calls an election
periodic_one,2,100
assert_is_candidate,2

# But this RequestVote is lost!
periodic_all,10
assert_is_backup,1
drop_pending,1 #< The ACKs from 1 are constantly dropped
drop_pending,2
dispatch_all_once
Expand All @@ -82,12 +81,13 @@ drop_pending,2
periodic_one,2,100
drop_pending,2

# TODO: Add more precise state assert? Currently 2 is @5.1, and is a Candidate
assert_is_candidate,2

# Eventually Node 1 stops hearing from Node 0, and calls an election
state_all
drop_pending,1
periodic_one,1,100
assert_is_candidate,1
dispatch_all_once #< Finally, everyone hears about this!

drop_pending,0 #< Node 0's response (in favour is dropped)
Expand All @@ -111,6 +111,7 @@ dispatch_all_once

# Node 1 is now primary, though it still doesn't know that 2 is committed
state_all
assert_is_primary,1

# Now we allow the network to heal and return to normal
periodic_all,10
Expand Down

0 comments on commit 1d46255

Please sign in to comment.