diff --git a/Makefile b/Makefile index 736a628adb..632790beb0 100644 --- a/Makefile +++ b/Makefile @@ -344,6 +344,12 @@ ifdef ROCKSDB_VALGRIND_RUN PLATFORM_CCFLAGS += -DROCKSDB_VALGRIND_RUN PLATFORM_CXXFLAGS += -DROCKSDB_VALGRIND_RUN endif +ifdef ROCKSDB_FULL_VALGRIND_RUN + # Some tests are slow when run under valgrind and are only run when + # explicitly requested via the ROCKSDB_FULL_VALGRIND_RUN compiler flag. + PLATFORM_CCFLAGS += -DROCKSDB_VALGRIND_RUN -DROCKSDB_FULL_VALGRIND_RUN + PLATFORM_CXXFLAGS += -DROCKSDB_VALGRIND_RUN -DROCKSDB_FULL_VALGRIND_RUN +endif ifndef DISABLE_JEMALLOC ifdef JEMALLOC @@ -1046,6 +1052,12 @@ ubsan_crash_test_with_best_efforts_recovery: clean COMPILE_WITH_UBSAN=1 $(MAKE) crash_test_with_best_efforts_recovery $(MAKE) clean +full_valgrind_test: + ROCKSDB_FULL_VALGRIND_RUN=1 DISABLE_JEMALLOC=1 $(MAKE) valgrind_check + +full_valgrind_test_some: + ROCKSDB_FULL_VALGRIND_RUN=1 DISABLE_JEMALLOC=1 $(MAKE) valgrind_check_some + valgrind_test: ROCKSDB_VALGRIND_RUN=1 DISABLE_JEMALLOC=1 $(MAKE) valgrind_check diff --git a/db/db_bloom_filter_test.cc b/db/db_bloom_filter_test.cc index 1405b737a5..8fe58cba1a 100644 --- a/db/db_bloom_filter_test.cc +++ b/db/db_bloom_filter_test.cc @@ -527,7 +527,7 @@ TEST_P(DBBloomFilterTestWithParam, BloomFilter) { } while (ChangeCompactOptions()); } -#ifndef ROCKSDB_VALGRIND_RUN +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) INSTANTIATE_TEST_CASE_P( FormatDef, DBBloomFilterTestDefFormatVersion, ::testing::Values( @@ -551,7 +551,7 @@ INSTANTIATE_TEST_CASE_P( test::kLatestFormatVersion), std::make_tuple(BFP::kAutoBloom, true, test::kLatestFormatVersion), std::make_tuple(BFP::kAutoBloom, false, test::kLatestFormatVersion))); -#endif // ROCKSDB_VALGRIND_RUN +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) TEST_F(DBBloomFilterTest, BloomFilterRate) { while (ChangeFilterOptions()) { diff --git a/db/db_compaction_filter_test.cc b/db/db_compaction_filter_test.cc index d5a8db1c3e..9046989127 100644 --- a/db/db_compaction_filter_test.cc +++ b/db/db_compaction_filter_test.cc @@ -46,7 +46,7 @@ class DBTestCompactionFilterWithCompactParam } }; -#ifndef ROCKSDB_VALGRIND_RUN +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) INSTANTIATE_TEST_CASE_P( CompactionFilterWithOption, DBTestCompactionFilterWithCompactParam, ::testing::Values(DBTestBase::OptionConfig::kDefault, @@ -55,11 +55,11 @@ INSTANTIATE_TEST_CASE_P( DBTestBase::OptionConfig::kLevelSubcompactions, DBTestBase::OptionConfig::kUniversalSubcompactions)); #else -// Run fewer cases in valgrind +// Run fewer cases in non-full valgrind to save time. INSTANTIATE_TEST_CASE_P(CompactionFilterWithOption, DBTestCompactionFilterWithCompactParam, ::testing::Values(DBTestBase::OptionConfig::kDefault)); -#endif // ROCKSDB_VALGRIND_RUN +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) class KeepFilter : public CompactionFilter { public: diff --git a/db/db_compaction_test.cc b/db/db_compaction_test.cc index 6cb1abfab1..c544768524 100644 --- a/db/db_compaction_test.cc +++ b/db/db_compaction_test.cc @@ -301,7 +301,7 @@ const SstFileMetaData* PickFileRandomly( } } // anonymous namespace -#ifndef ROCKSDB_VALGRIND_RUN +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) // All the TEST_P tests run once with sub_compactions disabled (i.e. // options.max_subcompactions = 1) and once with it enabled TEST_P(DBCompactionTestWithParam, CompactionDeletionTrigger) { @@ -366,7 +366,7 @@ TEST_P(DBCompactionTestWithParam, CompactionDeletionTrigger) { } } } -#endif // ROCKSDB_VALGRIND_RUN +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) TEST_P(DBCompactionTestWithParam, CompactionsPreserveDeletes) { // For each options type we test following diff --git a/db/db_iterator_test.cc b/db/db_iterator_test.cc index ae972ee967..559f555708 100644 --- a/db/db_iterator_test.cc +++ b/db/db_iterator_test.cc @@ -1536,9 +1536,11 @@ class DBIteratorTestForPinnedData : public DBIteratorTest { } }; +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) TEST_P(DBIteratorTestForPinnedData, PinnedDataIteratorRandomizedNormal) { PinnedDataIteratorRandomized(TestConfig::NORMAL); } +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) TEST_P(DBIteratorTestForPinnedData, PinnedDataIteratorRandomizedCLoseAndOpen) { PinnedDataIteratorRandomized(TestConfig::CLOSE_AND_OPEN); diff --git a/db/db_test.cc b/db/db_test.cc index 43b881b2b6..e34a41def0 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -3211,7 +3211,7 @@ class ModelDB : public DB { std::string name_ = ""; }; -#ifndef ROCKSDB_VALGRIND_RUN +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) static std::string RandomKey(Random* rnd, int minimum = 0) { int len; do { @@ -3366,7 +3366,7 @@ TEST_P(DBTestRandomized, Randomized) { if (model_snap != nullptr) model.ReleaseSnapshot(model_snap); if (db_snap != nullptr) db_->ReleaseSnapshot(db_snap); } -#endif // ROCKSDB_VALGRIND_RUN +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) TEST_F(DBTest, BlockBasedTablePrefixIndexTest) { // create a DB with block prefix index diff --git a/db/db_universal_compaction_test.cc b/db/db_universal_compaction_test.cc index 548b8ae0e0..38636bc9c2 100644 --- a/db/db_universal_compaction_test.cc +++ b/db/db_universal_compaction_test.cc @@ -635,7 +635,7 @@ TEST_P(DBTestUniversalCompaction, UniversalCompactionTargetLevel) { ASSERT_EQ("0,0,0,0,1", FilesPerLevel(0)); } -#ifndef ROCKSDB_VALGRIND_RUN +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) class DBTestUniversalCompactionMultiLevels : public DBTestUniversalCompactionBase { public: @@ -912,7 +912,7 @@ TEST_P(DBTestUniversalCompactionParallel, PickByFileNumberBug) { INSTANTIATE_TEST_CASE_P(Parallel, DBTestUniversalCompactionParallel, ::testing::Combine(::testing::Values(1, 10), ::testing::Values(false))); -#endif // ROCKSDB_VALGRIND_RUN +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) TEST_P(DBTestUniversalCompaction, UniversalCompactionOptions) { Options options = CurrentOptions(); @@ -1128,7 +1128,7 @@ TEST_P(DBTestUniversalCompaction, UniversalCompactionCompressRatio2) { ASSERT_LT(TotalSize(), 120000U * 12 * 0.82 + 120000 * 2); } -#ifndef ROCKSDB_VALGRIND_RUN +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) // Test that checks trivial move in universal compaction TEST_P(DBTestUniversalCompaction, UniversalCompactionTrivialMoveTest1) { int32_t trivial_move = 0; @@ -1221,7 +1221,7 @@ TEST_P(DBTestUniversalCompaction, UniversalCompactionTrivialMoveTest2) { ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->DisableProcessing(); } -#endif // ROCKSDB_VALGRIND_RUN +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) TEST_P(DBTestUniversalCompaction, UniversalCompactionFourPaths) { Options options = CurrentOptions(); diff --git a/db/db_with_timestamp_basic_test.cc b/db/db_with_timestamp_basic_test.cc index a227eb9395..f7aebd2633 100644 --- a/db/db_with_timestamp_basic_test.cc +++ b/db/db_with_timestamp_basic_test.cc @@ -1494,6 +1494,7 @@ TEST_F(DBBasicTestWithTimestamp, CompactDeletionWithTimestampMarkerToBottom) { Close(); } +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) class DBBasicTestWithTimestampFilterPrefixSettings : public DBBasicTestWithTimestampBase, public testing::WithParamInterface< @@ -1625,6 +1626,7 @@ INSTANTIATE_TEST_CASE_P( BlockBasedTableOptions::IndexType::kHashSearch, BlockBasedTableOptions::IndexType::kTwoLevelIndexSearch, BlockBasedTableOptions::IndexType::kBinarySearchWithFirstKey))); +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) class DataVisibilityTest : public DBBasicTestWithTimestampBase { public: @@ -2215,6 +2217,7 @@ TEST_F(DataVisibilityTest, MultiGetCrossCF) { Close(); } +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) class DBBasicTestWithTimestampCompressionSettings : public DBBasicTestWithTimestampBase, public testing::WithParamInterface< @@ -2954,6 +2957,7 @@ INSTANTIATE_TEST_CASE_P( BlockBasedTableOptions::IndexType::kHashSearch, BlockBasedTableOptions::IndexType::kTwoLevelIndexSearch, BlockBasedTableOptions::IndexType::kBinarySearchWithFirstKey))); +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) } // namespace ROCKSDB_NAMESPACE diff --git a/db/external_sst_file_test.cc b/db/external_sst_file_test.cc index afb8ba4594..66850c0a22 100644 --- a/db/external_sst_file_test.cc +++ b/db/external_sst_file_test.cc @@ -1398,6 +1398,7 @@ TEST_F(ExternalSSTFileTest, IngestNonExistingFile) { ASSERT_EQ(1, num_sst_files); } +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) TEST_F(ExternalSSTFileTest, CompactDuringAddFileRandom) { env_->skip_fsync_ = true; Options options = CurrentOptions(); @@ -1455,6 +1456,7 @@ TEST_F(ExternalSSTFileTest, CompactDuringAddFileRandom) { } } } +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) TEST_F(ExternalSSTFileTest, PickedLevelDynamic) { env_->skip_fsync_ = true; @@ -1716,6 +1718,7 @@ TEST_F(ExternalSSTFileTest, WithUnorderedWrite) { SyncPoint::GetInstance()->ClearAllCallBacks(); } +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) TEST_P(ExternalSSTFileTest, IngestFileWithGlobalSeqnoRandomized) { env_->skip_fsync_ = true; Options options = CurrentOptions(); @@ -1757,6 +1760,7 @@ TEST_P(ExternalSSTFileTest, IngestFileWithGlobalSeqnoRandomized) { VerifyDBFromMap(true_data, &kcnt, false); } } +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) TEST_P(ExternalSSTFileTest, IngestFileWithGlobalSeqnoAssignedLevel) { Options options = CurrentOptions(); diff --git a/db/write_callback_test.cc b/db/write_callback_test.cc index a2d3f94c4b..1dc659aad3 100644 --- a/db/write_callback_test.cc +++ b/db/write_callback_test.cc @@ -84,6 +84,7 @@ class MockWriteCallback : public WriteCallback { bool AllowWriteBatching() override { return allow_batching_; } }; +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) class WriteCallbackPTest : public WriteCallbackTest, public ::testing::WithParamInterface< @@ -376,6 +377,7 @@ INSTANTIATE_TEST_CASE_P(WriteCallbackPTest, WriteCallbackPTest, ::testing::Bool(), ::testing::Bool(), ::testing::Bool(), ::testing::Bool(), ::testing::Bool())); +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) TEST_F(WriteCallbackTest, WriteCallBackTest) { Options options; diff --git a/memtable/inlineskiplist_test.cc b/memtable/inlineskiplist_test.cc index f0a7053196..75b83f46ed 100644 --- a/memtable/inlineskiplist_test.cc +++ b/memtable/inlineskiplist_test.cc @@ -309,7 +309,7 @@ TEST_F(InlineSkipTest, InsertWithHint_CompatibleWithInsertWithoutHint) { Validate(&list); } -#ifndef ROCKSDB_VALGRIND_RUN +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) // We want to make sure that with a single writer and multiple // concurrent readers (with no synchronization other than when a // reader's iterator is created), the reader always observes all the @@ -654,7 +654,7 @@ TEST_F(InlineSkipTest, ConcurrentInsertWithHint3) { RunConcurrentInsert(3, true); } -#endif // ROCKSDB_VALGRIND_RUN +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) } // namespace ROCKSDB_NAMESPACE int main(int argc, char** argv) { diff --git a/table/table_test.cc b/table/table_test.cc index 2c5550a4f7..ac0d6b930b 100644 --- a/table/table_test.cc +++ b/table/table_test.cc @@ -3627,7 +3627,7 @@ TEST_F(GeneralTableTest, ApproximateOffsetOfCompressed) { } } -#ifndef ROCKSDB_VALGRIND_RUN +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) TEST_P(ParameterizedHarnessTest, RandomizedHarnessTest) { Random rnd(test::RandomSeed() + 5); for (int num_entries = 0; num_entries < 2000; @@ -3662,7 +3662,7 @@ TEST_F(DBHarnessTest, RandomizedLongDB) { ASSERT_GT(files, 0); } #endif // ROCKSDB_LITE -#endif // ROCKSDB_VALGRIND_RUN +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) class MemTableTest : public testing::Test { public: diff --git a/utilities/backupable/backupable_db_test.cc b/utilities/backupable/backupable_db_test.cc index a744095121..f537d134c8 100644 --- a/utilities/backupable/backupable_db_test.cc +++ b/utilities/backupable/backupable_db_test.cc @@ -1048,6 +1048,7 @@ TEST_P(BackupEngineTestWithParam, VerifyBackup) { CloseDBAndBackupEngine(); } +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) // open DB, write, close DB, backup, restore, repeat TEST_P(BackupEngineTestWithParam, OfflineIntegrationTest) { // has to be a big number, so that it triggers the memtable flush @@ -1158,6 +1159,7 @@ TEST_P(BackupEngineTestWithParam, OnlineIntegrationTest) { CloseBackupEngine(); } +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) INSTANTIATE_TEST_CASE_P(BackupEngineTestWithParam, BackupEngineTestWithParam, ::testing::Bool()); @@ -1548,6 +1550,7 @@ TEST_F(BackupEngineTest, BlobFileCorruptedBeforeBackup) { CloseDBAndBackupEngine(); } +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) // Test if BackupEngine will fail to create new backup if some table has been // corrupted and the table file checksum is stored in the DB manifest for the // case when backup table files will be stored in a shared directory @@ -1606,6 +1609,7 @@ TEST_P(BackupEngineTestWithParam, BlobFileCorruptedBeforeBackup) { ASSERT_NOK(backup_engine_->CreateNewBackup(db_.get())); CloseDBAndBackupEngine(); } +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) TEST_F(BackupEngineTest, TableFileWithoutDbChecksumCorruptedDuringBackup) { const int keys_iteration = 50000; @@ -2526,6 +2530,7 @@ TEST_F(BackupEngineTest, KeepLogFiles) { AssertBackupConsistency(0, 0, 500, 600, true); } +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) class BackupEngineRateLimitingTestWithParam : public BackupEngineTest, public testing::WithParamInterface< @@ -2600,6 +2605,7 @@ TEST_P(BackupEngineRateLimitingTestWithParam, RateLimiting) { AssertBackupConsistency(0, 0, 100000, 100010); } +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) TEST_F(BackupEngineTest, ReadOnlyBackupEngine) { DestroyDB(dbname_, options_); diff --git a/utilities/transactions/transaction_test.cc b/utilities/transactions/transaction_test.cc index 59c605857f..d8d12c92a0 100644 --- a/utilities/transactions/transaction_test.cc +++ b/utilities/transactions/transaction_test.cc @@ -62,8 +62,9 @@ INSTANTIATE_TEST_CASE_P( std::make_tuple(true, true, WRITE_PREPARED, kOrderedWrite), std::make_tuple(true, true, WRITE_UNPREPARED, kOrderedWrite))); -// MySQLStyleTransactionTest takes far too long for valgrind to run. -#ifndef ROCKSDB_VALGRIND_RUN +// MySQLStyleTransactionTest takes far too long for valgrind to run. Only do it +// in full mode (`ROCKSDB_FULL_VALGRIND_RUN` compiler flag is set). +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) INSTANTIATE_TEST_CASE_P( MySQLStyleTransactionTest, MySQLStyleTransactionTest, ::testing::Values( @@ -79,7 +80,7 @@ INSTANTIATE_TEST_CASE_P( std::make_tuple(false, true, WRITE_UNPREPARED, kOrderedWrite, true), std::make_tuple(false, true, WRITE_PREPARED, kUnorderedWrite, false), std::make_tuple(false, true, WRITE_PREPARED, kUnorderedWrite, true))); -#endif // ROCKSDB_VALGRIND_RUN +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) TEST_P(TransactionTest, DoubleEmptyWrite) { WriteOptions write_options; @@ -686,7 +687,7 @@ TEST_P(TransactionTest, DeadlockCycleShared) { } } -#ifndef ROCKSDB_VALGRIND_RUN +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) TEST_P(TransactionStressTest, DeadlockCycle) { WriteOptions write_options; ReadOptions read_options; @@ -849,7 +850,7 @@ TEST_P(TransactionStressTest, DeadlockStress) { t.join(); } } -#endif // ROCKSDB_VALGRIND_RUN +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) TEST_P(TransactionTest, CommitTimeBatchFailTest) { WriteOptions write_options; @@ -1182,7 +1183,7 @@ TEST_P(TransactionTest, TwoPhaseEmptyWriteTest) { } } -#ifndef ROCKSDB_VALGRIND_RUN +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) TEST_P(TransactionStressTest, TwoPhaseExpirationTest) { Status s; @@ -1420,7 +1421,7 @@ TEST_P(TransactionTest, PersistentTwoPhaseTransactionTest) { // deleting transaction should unregister transaction ASSERT_EQ(db->GetTransactionByName("xid"), nullptr); } -#endif // ROCKSDB_VALGRIND_RUN +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) // TODO this test needs to be updated with serial commits TEST_P(TransactionTest, DISABLED_TwoPhaseMultiThreadTest) { @@ -1504,6 +1505,7 @@ TEST_P(TransactionTest, DISABLED_TwoPhaseMultiThreadTest) { } } +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) TEST_P(TransactionStressTest, TwoPhaseLongPrepareTest) { WriteOptions write_options; write_options.sync = true; @@ -1614,6 +1616,7 @@ TEST_P(TransactionTest, TwoPhaseSequenceTest) { ASSERT_EQ(s, Status::OK()); ASSERT_EQ(value, "bar4"); } +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) TEST_P(TransactionTest, TwoPhaseDoubleRecoveryTest) { WriteOptions write_options; @@ -5356,7 +5359,7 @@ TEST_P(TransactionStressTest, ExpiredTransactionDataRace1) { ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->DisableProcessing(); } -#ifndef ROCKSDB_VALGRIND_RUN +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) namespace { // cmt_delay_ms is the delay between prepare and commit // first_id is the id of the first transaction @@ -5486,7 +5489,7 @@ TEST_P(MySQLStyleTransactionTest, TransactionStressTest) { !TAKE_SNAPSHOT); ASSERT_OK(s); } -#endif // ROCKSDB_VALGRIND_RUN +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) TEST_P(TransactionTest, MemoryLimitTest) { TransactionOptions txn_options; @@ -5520,6 +5523,7 @@ TEST_P(TransactionTest, MemoryLimitTest) { delete txn; } +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) // This test clarifies the existing expectation from the sequence number // algorithm. It could detect mistakes in updating the code but it is not // necessarily the one acceptable way. If the algorithm is legitimately changed, @@ -5643,6 +5647,7 @@ TEST_P(TransactionStressTest, SeqAdvanceTest) { ASSERT_OK(ReOpen()); } } +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) // Verify that the optimization would not compromize the correctness TEST_P(TransactionTest, Optimizations) { @@ -5693,7 +5698,7 @@ class ThreeBytewiseComparator : public Comparator { } }; -#ifndef ROCKSDB_VALGRIND_RUN +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) TEST_P(TransactionTest, GetWithoutSnapshot) { WriteOptions write_options; std::atomic finish = {false}; @@ -5722,7 +5727,7 @@ TEST_P(TransactionTest, GetWithoutSnapshot) { commit_thread.join(); read_thread.join(); } -#endif // ROCKSDB_VALGRIND_RUN +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) // Test that the transactional db can handle duplicate keys in the write batch TEST_P(TransactionTest, DuplicateKeys) { diff --git a/utilities/transactions/write_prepared_transaction_test.cc b/utilities/transactions/write_prepared_transaction_test.cc index 06abab7925..fd30c14910 100644 --- a/utilities/transactions/write_prepared_transaction_test.cc +++ b/utilities/transactions/write_prepared_transaction_test.cc @@ -542,7 +542,7 @@ class WritePreparedTransactionTest std::get<2>(GetParam()), std::get<3>(GetParam())){}; }; -#ifndef ROCKSDB_VALGRIND_RUN +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) class SnapshotConcurrentAccessTest : public WritePreparedTransactionTestBase, virtual public ::testing::WithParamInterface(db); @@ -1171,7 +1171,7 @@ TEST_P(WritePreparedTransactionTest, CheckAgainstSnapshots) { // This test is too slow for travis #ifndef TRAVIS -#ifndef ROCKSDB_VALGRIND_RUN +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) // Test that CheckAgainstSnapshots will not miss a live snapshot if it is run in // parallel with UpdateSnapshots. TEST_P(SnapshotConcurrentAccessTest, SnapshotConcurrentAccess) { @@ -1251,7 +1251,7 @@ TEST_P(SnapshotConcurrentAccessTest, SnapshotConcurrentAccess) { } printf("\n"); } -#endif // ROCKSDB_VALGRIND_RUN +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) #endif // TRAVIS // This test clarifies the contract of AdvanceMaxEvictedSeq method @@ -1580,7 +1580,7 @@ TEST_P(WritePreparedTransactionTest, AdvanceMaxEvictedSeqWithDuplicates) { delete txn0; } -#ifndef ROCKSDB_VALGRIND_RUN +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) // Stress SmallestUnCommittedSeq, which reads from both prepared_txns_ and // delayed_prepared_, when is run concurrently with advancing max_evicted_seq, // which moves prepared txns from prepared_txns_ to delayed_prepared_. @@ -1642,7 +1642,7 @@ TEST_P(WritePreparedTransactionTest, SmallestUnCommittedSeq) { delete txn; } } -#endif // ROCKSDB_VALGRIND_RUN +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) TEST_P(SeqAdvanceConcurrentTest, SeqAdvanceConcurrent) { // Given the sequential run of txns, with this timeout we should never see a diff --git a/utilities/transactions/write_unprepared_transaction_test.cc b/utilities/transactions/write_unprepared_transaction_test.cc index 0c1d32e359..4940487eab 100644 --- a/utilities/transactions/write_unprepared_transaction_test.cc +++ b/utilities/transactions/write_unprepared_transaction_test.cc @@ -136,7 +136,7 @@ TEST_P(WriteUnpreparedTransactionTest, ReadYourOwnWrite) { } } -#ifndef ROCKSDB_VALGRIND_RUN +#if !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) TEST_P(WriteUnpreparedStressTest, ReadYourOwnWriteStress) { // This is a stress test where different threads are writing random keys, and // then before committing or aborting the transaction, it validates to see @@ -314,7 +314,7 @@ TEST_P(WriteUnpreparedStressTest, ReadYourOwnWriteStress) { t.join(); } } -#endif // ROCKSDB_VALGRIND_RUN +#endif // !defined(ROCKSDB_VALGRIND_RUN) || defined(ROCKSDB_FULL_VALGRIND_RUN) // This tests how write unprepared behaves during recovery when the DB crashes // after a transaction has either been unprepared or prepared, and tests if