Skip to content

Commit

Permalink
Raft scenarios falsifying Heidi's hypothesis about raft.h's behavior.
Browse files Browse the repository at this point in the history
Execute with:

```shell
.../build $ python3 ../tests/raft_scenarios_runner.py ./raft_driver ../tests/raft_scenarios/5879_deprecated
    ```
  • Loading branch information
lemmy committed Dec 27, 2023
1 parent 21f487e commit 68b90ec
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions tests/raft_scenarios/5879_deprecated
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
nodes,0,1
connect,0,1

# Node 0 starts first, and begins sending messages first
periodic_one,0,110
dispatch_all

periodic_all,30
dispatch_all

state_all
assert_is_primary,0
assert_is_backup,1

## ... with the same logs upto index 7.
replicate,1,txAtIdx1
replicate,1,txAtIdx2
replicate,1,txAtIdx3
replicate,1,txAtIdx4
replicate,1,txAtIdx5
replicate,1,txAtIdx6
emit_signature,1
periodic_all,30
dispatch_all

assert_commit_idx,0,7
assert_commit_idx,1,0

periodic_all,30
dispatch_all
assert_state_sync

assert_commit_idx,0,7
assert_commit_idx,1,7

## At index 8, the leader n2 reconfigures to remove n1.
replicate_new_configuration,1,0

periodic_all,30
dispatch_all

state_all
assert_is_primary,0
assert_is_backup,1
## Index 9 is a signature, index 10 some random transaction and index 11 is a signature.
emit_signature,1
assert_commit_idx,0,7

replicate,1,txAt10
assert_commit_idx,0,7

emit_signature,1
assert_commit_idx,0,7


## When the ACI action taken by n2, it should be able to commit index 11 but instead it will commit index 9.
periodic_all,30
dispatch_all

assert_is_primary,0
assert_is_backup,1
assert_is_retired,1

assert_commit_idx,0,11
assert_commit_idx,1,7

0 comments on commit 68b90ec

Please sign in to comment.