Skip to content

Commit

Permalink
Merge pull request #1495 from tigerbeetle/dj-test-forfeit-cleanup
Browse files Browse the repository at this point in the history
Test: Cleanup "forfeit" replica_test; add assertions
  • Loading branch information
sentientwaffle committed Jan 30, 2024
2 parents f28ffb7 + 504ac3f commit d392df0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/vsr/replica_test.zig
Original file line number Diff line number Diff line change
Expand Up @@ -467,11 +467,12 @@ test "Cluster: repair: view-change, new-primary lagging behind checkpoint, forfe

b1.drop_all(.__, .bidirectional);

try c.request(checkpoint_1_trigger - 1, checkpoint_1_trigger - 1);
try expectEqual(a0.commit(), checkpoint_1_trigger - 1);
try c.request(checkpoint_1_trigger, checkpoint_1_trigger);
try expectEqual(a0.commit(), checkpoint_1_trigger);
try expectEqual(b1.commit(), 20);
try expectEqual(b2.commit(), checkpoint_1_trigger - 1);
try expectEqual(b2.commit(), checkpoint_1_trigger);

// Ensure that B2 does not commit op=trigger+1.
b2.drop(.__, .incoming, .commit);
try c.request(checkpoint_1_trigger + 1, checkpoint_1_trigger + 1);
try expectEqual(a0.op_checkpoint(), checkpoint_1);
Expand All @@ -480,6 +481,9 @@ test "Cluster: repair: view-change, new-primary lagging behind checkpoint, forfe
try expectEqual(a0.commit(), checkpoint_1_trigger + 1);
try expectEqual(b1.commit(), 20);
try expectEqual(b2.commit(), checkpoint_1_trigger);
try expectEqual(a0.op_head(), checkpoint_1_trigger + 1);
try expectEqual(b1.op_head(), 20);
try expectEqual(b2.op_head(), checkpoint_1_trigger + 1);

// Partition the primary, but restore B1. B1 will attempt to become the primary next,
// but it is too far behind, so B2 becomes the new primary instead.
Expand Down

0 comments on commit d392df0

Please sign in to comment.