diff --git a/db/corruption_test.cc b/db/corruption_test.cc index 7a1a5221b..09d78f89f 100644 --- a/db/corruption_test.cc +++ b/db/corruption_test.cc @@ -332,6 +332,9 @@ TEST(CorruptionTest, CorruptedDescriptor) { } TEST(CorruptionTest, CompactionInputError) { + Options options; + options.max_background_flushes = 0; + Reopen(&options); Build(10); DBImpl* dbi = reinterpret_cast(db_); dbi->TEST_FlushMemTable(); @@ -351,6 +354,7 @@ TEST(CorruptionTest, CompactionInputErrorParanoid) { options.paranoid_checks = true; options.write_buffer_size = 131072; options.max_write_buffer_number = 2; + options.max_background_flushes = 0; Reopen(&options); DBImpl* dbi = reinterpret_cast(db_); diff --git a/db/db_test.cc b/db/db_test.cc index 796792b22..7ad249d7f 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -1325,6 +1325,7 @@ TEST(DBTest, IndexAndFilterBlocksOfNewTableAddedToCache) { TEST(DBTest, GetPropertiesOfAllTablesTest) { Options options = CurrentOptions(); + options.max_background_flushes = 0; Reopen(&options); // Create 4 tables for (int table = 0; table < 4; ++table) { @@ -1520,7 +1521,10 @@ TEST(DBTest, GetPicksCorrectFile) { TEST(DBTest, GetEncountersEmptyLevel) { do { - CreateAndReopenWithCF({"pikachu"}); + Options options = CurrentOptions(); + options.max_background_flushes = 0; + options.disableDataSync = true; + CreateAndReopenWithCF({"pikachu"}, &options); // Arrange for the following to happen: // * sstable A in level 0 // * nothing in level 1 @@ -5124,7 +5128,9 @@ TEST(DBTest, Snapshot) { TEST(DBTest, HiddenValuesAreRemoved) { do { - CreateAndReopenWithCF({"pikachu"}); + Options options = CurrentOptions(); + options.max_background_flushes = 0; + CreateAndReopenWithCF({"pikachu"}, &options); Random rnd(301); FillLevels("a", "z", 1); @@ -5215,7 +5221,9 @@ TEST(DBTest, CompactBetweenSnapshots) { } TEST(DBTest, DeletionMarkers1) { - CreateAndReopenWithCF({"pikachu"}); + Options options = CurrentOptions(); + options.max_background_flushes = 0; + CreateAndReopenWithCF({"pikachu"}, &options); Put(1, "foo", "v1"); ASSERT_OK(Flush(1)); const int last = CurrentOptions().max_mem_compaction_level; @@ -5250,7 +5258,9 @@ TEST(DBTest, DeletionMarkers1) { } TEST(DBTest, DeletionMarkers2) { - CreateAndReopenWithCF({"pikachu"}); + Options options = CurrentOptions(); + options.max_background_flushes = 0; + CreateAndReopenWithCF({"pikachu"}, &options); Put(1, "foo", "v1"); ASSERT_OK(Flush(1)); const int last = CurrentOptions().max_mem_compaction_level; @@ -5279,7 +5289,9 @@ TEST(DBTest, DeletionMarkers2) { TEST(DBTest, OverlapInLevel0) { do { - CreateAndReopenWithCF({"pikachu"}); + Options options = CurrentOptions(); + options.max_background_flushes = 0; + CreateAndReopenWithCF({"pikachu"}, &options); int tmp = CurrentOptions().max_mem_compaction_level; ASSERT_EQ(tmp, 2) << "Fix test to match config"; @@ -5457,7 +5469,9 @@ TEST(DBTest, CustomComparator) { } TEST(DBTest, ManualCompaction) { - CreateAndReopenWithCF({"pikachu"}); + Options options = CurrentOptions(); + options.max_background_flushes = 0; + CreateAndReopenWithCF({"pikachu"}, &options); ASSERT_EQ(dbfull()->MaxMemCompactionLevel(), 2) << "Need to update this test to match kMaxMemCompactLevel"; @@ -5495,6 +5509,7 @@ TEST(DBTest, ManualCompaction) { if (iter == 0) { Options options = CurrentOptions(); + options.max_background_flushes = 0; options.num_levels = 3; options.create_if_missing = true; DestroyAndReopen(&options); @@ -5594,6 +5609,7 @@ TEST(DBTest, DBOpen_Options) { TEST(DBTest, DBOpen_Change_NumLevels) { Options opts; opts.create_if_missing = true; + opts.max_background_flushes = 0; DestroyAndReopen(&opts); ASSERT_TRUE(db_ != nullptr); CreateAndReopenWithCF({"pikachu"}, &opts); @@ -5777,6 +5793,7 @@ TEST(DBTest, ManifestWriteError) { options.env = env_; options.create_if_missing = true; options.error_if_exists = false; + options.max_background_flushes = 0; DestroyAndReopen(&options); ASSERT_OK(Put("foo", "bar")); ASSERT_EQ("bar", Get("foo")); diff --git a/db/deletefile_test.cc b/db/deletefile_test.cc index 14f0324c1..a5af31284 100644 --- a/db/deletefile_test.cc +++ b/db/deletefile_test.cc @@ -34,6 +34,7 @@ class DeleteFileTest { DeleteFileTest() { db_ = nullptr; env_ = Env::Default(); + options_.max_background_flushes = 0; options_.write_buffer_size = 1024*1024*1000; options_.target_file_size_base = 1024*1024*1000; options_.max_bytes_for_level_base = 1024*1024*1000; diff --git a/tools/reduce_levels_test.cc b/tools/reduce_levels_test.cc index b41f36d01..b1d58e10e 100644 --- a/tools/reduce_levels_test.cc +++ b/tools/reduce_levels_test.cc @@ -76,6 +76,7 @@ Status ReduceLevelTest::OpenDB(bool create_if_missing, int num_levels, opt.num_levels = num_levels; opt.create_if_missing = create_if_missing; opt.max_mem_compaction_level = mem_table_compact_level; + opt.max_background_flushes = 0; rocksdb::Status st = rocksdb::DB::Open(opt, dbname_, &db_); if (!st.ok()) { fprintf(stderr, "Can't open the db:%s\n", st.ToString().c_str());