From 82f148ef97a0c9405d81290e903aaa9ebfaccf72 Mon Sep 17 00:00:00 2001 From: sdong Date: Wed, 22 Jul 2015 13:45:08 -0700 Subject: [PATCH] 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 --- db/db_compaction_test.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/db/db_compaction_test.cc b/db/db_compaction_test.cc index 8ae08ee4a..b67a5c1e9 100644 --- a/db/db_compaction_test.cc +++ b/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);