From 9d35ae649ef1efaa5d3f5ec094adcd0f26c16349 Mon Sep 17 00:00:00 2001 From: sdong Date: Fri, 15 Apr 2016 15:44:42 -0700 Subject: [PATCH] Make DBTestUniversalCompaction.IncreaseUniversalCompactionNumLevels more deterministic Summary: DBTestUniversalCompaction, IncreaseUniversalCompactionNumLevels fails one in about 30 runs when running in parallel. We wait for compaction after each flush to make the compaction behavior deterministic. Test Plan: Run the test 1000 times in parallel and it still passes. Reviewers: yhchiang, IslamAbdelRahman Reviewed By: IslamAbdelRahman Subscribers: kradhakrishnan, yiwu, leveldb, andrewkr, dhruba Differential Revision: https://reviews.facebook.net/D56841 --- db/db_universal_compaction_test.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/db/db_universal_compaction_test.cc b/db/db_universal_compaction_test.cc index 7fb4ac7bba..ded8ed9b4d 100644 --- a/db/db_universal_compaction_test.cc +++ b/db/db_universal_compaction_test.cc @@ -1091,6 +1091,7 @@ TEST_P(DBTestUniversalCompaction, IncreaseUniversalCompactionNumLevels) { // each value is 10K ASSERT_OK(Put(1, Key(i), RandomString(&rnd, 10000))); dbfull()->TEST_WaitForFlushMemTable(handles_[1]); + dbfull()->TEST_WaitForCompact(); } ASSERT_OK(Flush(1)); dbfull()->TEST_WaitForCompact(); @@ -1108,6 +1109,7 @@ TEST_P(DBTestUniversalCompaction, IncreaseUniversalCompactionNumLevels) { // each value is 10K ASSERT_OK(Put(1, Key(i), RandomString(&rnd, 10000))); dbfull()->TEST_WaitForFlushMemTable(handles_[1]); + dbfull()->TEST_WaitForCompact(); } ASSERT_OK(Flush(1)); dbfull()->TEST_WaitForCompact(); @@ -1139,6 +1141,7 @@ TEST_P(DBTestUniversalCompaction, IncreaseUniversalCompactionNumLevels) { // each value is 10K ASSERT_OK(Put(1, Key(i), RandomString(&rnd, 10000))); dbfull()->TEST_WaitForFlushMemTable(handles_[1]); + dbfull()->TEST_WaitForCompact(); } ASSERT_OK(Flush(1)); dbfull()->TEST_WaitForCompact();