Skip to content

Commit

Permalink
Fix failed ut
Browse files Browse the repository at this point in the history
  • Loading branch information
heng committed Aug 21, 2019
1 parent bfee6d9 commit 471171e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/kvstore/raftex/test/SnapshotTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ TEST(SnapshotTest, LearnerCatchUpDataTest) {

std::vector<std::string> msgs;
for (int i = 0; i < 10; i++) {
appendLogs(i * 100, i * 100 + 99, leader, msgs);
// sleep a while to avoid buffer overflow
usleep(500000);
appendLogs(i * 100, i * 100 + 99, leader, msgs, true);
}
// Sleep a while to make sure the last log has been committed on followers
sleep(FLAGS_raft_heartbeat_interval_secs);
Expand All @@ -74,9 +72,7 @@ TEST(SnapshotTest, LearnerCatchUpDataTest) {

LOG(INFO) << "Let's continue to write some logs";
for (int i = 10; i < 20; i++) {
appendLogs(i * 100, i * 100 + 99, leader, msgs);
// sleep a while to avoid buffer overflow
usleep(500000);
appendLogs(i * 100, i * 100 + 99, leader, msgs, true);
}
sleep(FLAGS_raft_heartbeat_interval_secs);

Expand Down

0 comments on commit 471171e

Please sign in to comment.