From 9d3b2db9b55641052eaf64b9f66b201025084926 Mon Sep 17 00:00:00 2001 From: Andrew Kryczka Date: Tue, 15 Sep 2020 18:53:53 -0700 Subject: [PATCH] Disable fsync in DB tests with timeouts (#7380) Summary: Some tests were encountering 600 second timeout in CI, such as `./db_universal_compaction_test --gtest_filter=NumLevels/DBTestUniversalCompaction.UniversalCompactionTrivialMoveTest2/5`, `./db_properties_test --gtest_filter=DBPropertiesTest.AggregatedTablePropertiesAtLevel`, and `./db_basic_test --gtest_filter=DBBasicTest.MultiGetBatchedSortedMultiFile`. Pull Request resolved: https://github.com/facebook/rocksdb/pull/7380 Test Plan: - `./db_universal_compaction_test --gtest_filter=NumLevels/DBTestUniversalCompaction.UniversalCompactionTrivialMoveTest2/5`: 40 -> 3 seconds - `./db_properties_test --gtest_filter=DBPropertiesTest.AggregatedTablePropertiesAtLevel`: 106 -> 1 second - `./db_basic_test --gtest_filter=DBBasicTest.MultiGetBatchedSortedMultiFile`: 27 -> 1 second Reviewed By: anand1976 Differential Revision: D23674570 Pulled By: ajkr fbshipit-source-id: 4d4ca6a4e2d2e76fcf8b6f6cce91e0f98ba5050c --- db/db_basic_test.cc | 4 ++-- db/db_properties_test.cc | 2 +- db/db_universal_compaction_test.cc | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/db/db_basic_test.cc b/db/db_basic_test.cc index c9483faf9..428772874 100644 --- a/db/db_basic_test.cc +++ b/db/db_basic_test.cc @@ -28,7 +28,7 @@ namespace ROCKSDB_NAMESPACE { class DBBasicTest : public DBTestBase { public: - DBBasicTest() : DBTestBase("/db_basic_test", /*env_do_fsync=*/true) {} + DBBasicTest() : DBTestBase("/db_basic_test", /*env_do_fsync=*/false) {} }; TEST_F(DBBasicTest, OpenWhenOpen) { @@ -2391,7 +2391,7 @@ class DBBasicTestMultiGet : public DBTestBase { DBBasicTestMultiGet(std::string test_dir, int num_cfs, bool compressed_cache, bool uncompressed_cache, bool _compression_enabled, bool _fill_cache, uint32_t compression_parallel_threads) - : DBTestBase(test_dir, /*env_do_fsync=*/true) { + : DBTestBase(test_dir, /*env_do_fsync=*/false) { compression_enabled_ = _compression_enabled; fill_cache_ = _fill_cache; diff --git a/db/db_properties_test.cc b/db/db_properties_test.cc index 6e9a0d135..043542744 100644 --- a/db/db_properties_test.cc +++ b/db/db_properties_test.cc @@ -27,7 +27,7 @@ namespace ROCKSDB_NAMESPACE { class DBPropertiesTest : public DBTestBase { public: DBPropertiesTest() - : DBTestBase("/db_properties_test", /*env_do_fsync=*/true) {} + : DBTestBase("/db_properties_test", /*env_do_fsync=*/false) {} }; #ifndef ROCKSDB_LITE diff --git a/db/db_universal_compaction_test.cc b/db/db_universal_compaction_test.cc index ce5a889a1..c9dddd9a7 100644 --- a/db/db_universal_compaction_test.cc +++ b/db/db_universal_compaction_test.cc @@ -27,7 +27,7 @@ class DBTestUniversalCompactionBase public ::testing::WithParamInterface> { public: explicit DBTestUniversalCompactionBase(const std::string& path) - : DBTestBase(path, /*env_do_fsync=*/true) {} + : DBTestBase(path, /*env_do_fsync=*/false) {} void SetUp() override { num_levels_ = std::get<0>(GetParam()); exclusive_manual_compaction_ = std::get<1>(GetParam()); @@ -45,7 +45,7 @@ class DBTestUniversalCompaction : public DBTestUniversalCompactionBase { class DBTestUniversalCompaction2 : public DBTestBase { public: DBTestUniversalCompaction2() - : DBTestBase("/db_universal_compaction_test2", /*env_do_fsync=*/true) {} + : DBTestBase("/db_universal_compaction_test2", /*env_do_fsync=*/false) {} }; namespace {