From: sdong Date: Tue, 1 Dec 2015 06:16:49 +0000 (-0800) Subject: Fix DBCompactionTestWithParam.CompactionTrigger in non-jemalloc build. X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0ad68518bb2e04707c06b6c87535b21ae44b6ced;p=rocksdb.git Fix DBCompactionTestWithParam.CompactionTrigger in non-jemalloc build. Summary: DBCompactionTestWithParam.CompactionTrigger fails in non-jemalloc build, after the skip list memtable change. Fix it by making mem table flush trigger by number of entries. Test Plan: Run the test using both of jemalloc and non-jemalloc build. Reviewers: anthony, IslamAbdelRahman, rven, kradhakrishnan, igor, yhchiang Reviewed By: yhchiang Subscribers: leveldb, dhruba Differential Revision: https://reviews.facebook.net/D51471 --- diff --git a/db/db_compaction_test.cc b/db/db_compaction_test.cc index baf35c67..631db2a9 100644 --- a/db/db_compaction_test.cc +++ b/db/db_compaction_test.cc @@ -461,12 +461,15 @@ TEST_F(DBCompactionTest, DisableStatsUpdateReopen) { TEST_P(DBCompactionTestWithParam, CompactionTrigger) { + int kNumKeysPerFile = 100; + Options options; - options.write_buffer_size = 110 << 10; // 110KB + options.write_buffer_size = 200 << 10; options.arena_block_size = 4 << 10; options.num_levels = 3; options.level0_file_num_compaction_trigger = 3; options.max_subcompactions = max_subcompactions_; + options.memtable_factory.reset(new SpecialSkipListFactory(kNumKeysPerFile)); options = CurrentOptions(options); CreateAndReopenWithCF({"pikachu"}, options); @@ -476,10 +479,11 @@ TEST_P(DBCompactionTestWithParam, CompactionTrigger) { num++) { std::vector values; // Write 100KB (100 values, each 1K) - for (int i = 0; i < 100; i++) { + for (int i = 0; i < kNumKeysPerFile; i++) { values.push_back(RandomString(&rnd, 990)); ASSERT_OK(Put(1, Key(i), values[i])); } + ASSERT_OK(Put(1, "", "")); dbfull()->TEST_WaitForFlushMemTable(handles_[1]); ASSERT_EQ(NumTableFilesAtLevel(0, 1), num + 1); }