Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
More raft_fixture_disk_write_fault in the tests
Browse files Browse the repository at this point in the history
Signed-off-by: Cole Miller <[email protected]>
  • Loading branch information
cole-miller committed Nov 27, 2023
1 parent 050ee00 commit 1b41a11
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/integration/test_replication.c
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ TEST(replication, diskWriteFailure, setUp, tearDown, 0, NULL)
req->data = (void *)(intptr_t)RAFT_IOERR;
BOOTSTRAP_START_AND_ELECT;

CLUSTER_IO_FAULT(0, 1, 1);
raft_fixture_disk_write_fault(&f->cluster, 0, 0);
CLUSTER_APPLY_ADD_X(0, req, 1, applyAssertStatusCb);
/* The leader steps down when its disk write fails. */
CLUSTER_STEP_UNTIL_STATE_IS(0, RAFT_FOLLOWER, 2000);
Expand Down Expand Up @@ -1198,7 +1198,7 @@ TEST(replication, failPersistBarrier, setUp, tearDown, 0, NULL)
CLUSTER_GROW;

/* Server 0 will fail to persist entry 2, a barrier */
CLUSTER_IO_FAULT(0, 10, 1);
raft_fixture_disk_write_fault(&f->cluster, 0, 0);

/* Server 0 gets elected and creates a barrier entry at index 2 */
CLUSTER_BOOTSTRAP;
Expand All @@ -1220,8 +1220,8 @@ TEST(replication, failPersistBarrierFollower, setUp, tearDown, 0, NULL)
CLUSTER_GROW;

/* The servers will fail to persist entry 2, a barrier */
CLUSTER_IO_FAULT(1, 7, 1);
CLUSTER_IO_FAULT(2, 7, 1);
raft_fixture_disk_write_fault(&f->cluster, 1, 0);
raft_fixture_disk_write_fault(&f->cluster, 2, 0);

/* Server 0 gets elected and creates a barrier entry at index 2 */
CLUSTER_BOOTSTRAP;
Expand Down

0 comments on commit 1b41a11

Please sign in to comment.