DBTest.HardLimit made more deterministic

Summary: In DBTest.HardLimit, multiple flushes may merge into one, based on thread scheduling. Avoid it by waiting each flush to finish before generating the next one.

Test Plan: Run test in parallel several times and see it doesn't fail any more.

Reviewers: yhchiang, kradhakrishnan, IslamAbdelRahman

Reviewed By: IslamAbdelRahman

Subscribers: yiwu, leveldb, andrewkr, dhruba

Differential Revision: https://reviews.facebook.net/D56853
main
sdong 9 years ago
parent 994d9bc82b
commit 6d436a3f85
  1. 1
      db/db_test.cc

@ -8393,6 +8393,7 @@ TEST_F(DBTest, HardLimit) {
int key_idx = 0; int key_idx = 0;
for (int num = 0; num < 5; num++) { for (int num = 0; num < 5; num++) {
GenerateNewFile(&rnd, &key_idx, true); GenerateNewFile(&rnd, &key_idx, true);
dbfull()->TEST_WaitForFlushMemTable();
} }
ASSERT_EQ(0, callback_count.load()); ASSERT_EQ(0, callback_count.load());

Loading…
Cancel
Save