Skip to content

Commit

Permalink
Fix to transfer test issue (#485)
Browse files Browse the repository at this point in the history
  • Loading branch information
greensky00 authored Feb 14, 2024
1 parent 78bae70 commit 6f1a54d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/unit/asio_service_test.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1330,14 +1330,17 @@ int leadership_transfer_test() {
s3->stopAsio();
delete s3;

// Wait enough time so that S1 can detect S3's failure.
TestSuite::sleep_sec(2, "shutdown S3 and wait");

// Set the parameter to enable transfer (S1).
s1->raftServer->update_params(params);

// Set S2's priority higher than S1
CHK_EQ( raft_server::PrioritySetResult::SET, s1->raftServer->set_priority(2, 100) );

// Due to S3, transfer shouldn't happen.
TestSuite::sleep_sec(2, "shutdown S3, set priority of S2, and wait");
TestSuite::sleep_sec(2, "set priority of S2 and wait");
CHK_TRUE( s1->raftServer->is_leader() );

s3 = new RaftAsioPkg(3, s3_addr);
Expand Down

0 comments on commit 6f1a54d

Please sign in to comment.