Fix test DBCompactionTest.PartialCompactionFailure undeterministic failure

Summary: DBCompactionTest.PartialCompactionFailure has a risk that one flush job writes out two mem tables into one file, so that the total files flushed are less than expected. Fix it by writing for flush to finish after every write.

Test Plan: Run the test

Reviewers: IslamAbdelRahman, kradhakrishnan, yhchiang, anthony

Reviewed By: anthony

Subscribers: leveldb, dhruba

Differential Revision: https://reviews.facebook.net/D42831
main
sdong 10 years ago
parent 6002801e09
commit 82f148ef97
  1. 1
      db/db_compaction_test.cc

@ -1278,6 +1278,7 @@ TEST_F(DBCompactionTest, PartialCompactionFailure) {
keys.emplace_back(RandomString(&rnd, kKeySize));
values.emplace_back(RandomString(&rnd, kKvSize - kKeySize));
ASSERT_OK(Put(Slice(keys[k]), Slice(values[k])));
dbfull()->TEST_WaitForFlushMemTable();
}
dbfull()->TEST_FlushMemTable(true);

Loading…
Cancel
Save