]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
Make CompactionJobStatsTest.UniversalCompactionTest more robust
authorYueh-Hsuan Chiang <yhchiang@fb.com>
Mon, 28 Sep 2015 20:52:39 +0000 (13:52 -0700)
committerIslam AbdelRahman <tec@fb.com>
Wed, 30 Sep 2015 18:15:35 +0000 (11:15 -0700)
Summary:
CompactionJobStatsTest.UniversalCompactionTest assumes compaction
kicks in when the number of L0 files equals to the compaction trigger.
However, in some case, the compaction might not catch up the write
speed and thus compaction might not kick in until the number of L0 files
is GREATER than the compaction trigger.

This patch tries to fix this corner case by making the Put thread wait
for a potential compaction whenever it flushes.

Test Plan: ./compaction_job_stats_test

Reviewers: sdong, anthony, IslamAbdelRahman, igor

Subscribers: dhruba

Differential Revision: https://reviews.facebook.net/D47589

db/compaction_job_stats_test.cc

index 516b75d5c9ad4ee65da94765622cfc5fbbe24004..3d17fd978f29790ec60d788c5361aa268cab972e 100644 (file)
@@ -1014,8 +1014,8 @@ TEST_P(CompactionJobStatsTest, UniversalCompactionTest) {
         &rnd, start_key, start_key + key_base - 1,
         kKeySize, kValueSize, key_interval,
         compression_ratio, 1);
+    reinterpret_cast<DBImpl*>(db_)->TEST_WaitForCompact();
   }
-  reinterpret_cast<DBImpl*>(db_)->TEST_WaitForCompact();
   ASSERT_EQ(stats_checker->NumberOfUnverifiedStats(), 0U);
 }