]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
Fix DBCompactionTestWithParam.CompactionTrigger in non-jemalloc build.
authorsdong <siying.d@fb.com>
Tue, 1 Dec 2015 06:16:49 +0000 (22:16 -0800)
committersdong <siying.d@fb.com>
Tue, 1 Dec 2015 20:25:22 +0000 (12:25 -0800)
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

db/db_compaction_test.cc

index baf35c672831ac3ee167d0a11460787ada20085e..631db2a913bd18e6f211f4a1b00b57d494b896e8 100644 (file)
@@ -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<std::string> 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);
   }