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
This commit is contained in:
sdong 2015-07-22 13:45:08 -07:00
parent 6002801e09
commit 82f148ef97

View File

@ -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);