diff options
author | Dianna Hohensee <dianna.hohensee@mongodb.com> | 2020-03-05 19:01:26 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-03-13 15:10:49 +0000 |
commit | 33076ddc839fda1e5c5dec91d616e56c2e9d40ab (patch) | |
tree | 3304ba23c72604d17d051c329d63a30d2ecc3d1d /src/mongo/dbtests | |
parent | d1b708e595e46846b76aa3172b36278848939700 (diff) | |
download | mongo-33076ddc839fda1e5c5dec91d616e56c2e9d40ab.tar.gz |
SERVER-46666 Add extra validate logging for unit tests for debug proposes
rename src/mongo/db/storage/{storage_unittest_debug_util.cpp => storage_debug_util.cpp} (73%)
rename src/mongo/db/storage/{storage_unittest_debug_util.h => storage_debug_util.h} (80%)
(cherry picked from commit 86d40fda4d156c0a439f1c5edb2b7890a085d337)
rename src/mongo/db/storage/{storage_unittest_debug_util.cpp => storage_debug_util.cpp} (73%)
rename src/mongo/db/storage/{storage_unittest_debug_util.h => storage_debug_util.h} (80%)
Diffstat (limited to 'src/mongo/dbtests')
-rw-r--r-- | src/mongo/dbtests/SConscript | 2 | ||||
-rw-r--r-- | src/mongo/dbtests/validate_tests.cpp | 18 |
2 files changed, 13 insertions, 7 deletions
diff --git a/src/mongo/dbtests/SConscript b/src/mongo/dbtests/SConscript index 28097a6453b..8c26c01d965 100644 --- a/src/mongo/dbtests/SConscript +++ b/src/mongo/dbtests/SConscript @@ -161,7 +161,7 @@ if not has_option('noshell') and usemozjs: "$BUILD_DIR/mongo/db/storage/durable_catalog_impl", "$BUILD_DIR/mongo/db/storage/ephemeral_for_test/storage_ephemeral_for_test", "$BUILD_DIR/mongo/db/storage/storage_engine_impl", - "$BUILD_DIR/mongo/db/storage/storage_unittest_debug_util", + "$BUILD_DIR/mongo/db/storage/storage_debug_util", "$BUILD_DIR/mongo/db/storage/wiredtiger/storage_wiredtiger" if wiredtiger else [], "$BUILD_DIR/mongo/db/transaction", "$BUILD_DIR/mongo/shell_core", diff --git a/src/mongo/dbtests/validate_tests.cpp b/src/mongo/dbtests/validate_tests.cpp index 275fd35e0eb..36a7f3a5b92 100644 --- a/src/mongo/dbtests/validate_tests.cpp +++ b/src/mongo/dbtests/validate_tests.cpp @@ -40,7 +40,7 @@ #include "mongo/db/index/index_access_method.h" #include "mongo/db/index/index_descriptor.h" #include "mongo/db/service_context.h" -#include "mongo/db/storage/storage_unittest_debug_util.h" +#include "mongo/db/storage/storage_debug_util.h" #include "mongo/dbtests/dbtests.h" namespace ValidateTests { @@ -48,7 +48,10 @@ namespace ValidateTests { using std::unique_ptr; namespace { + const auto kIndexVersion = IndexDescriptor::IndexVersion::kV2; +const bool kTurnOnExtraLoggingForTest = true; + } // namespace static const char* const _ns = "unittests.validate_tests"; @@ -105,8 +108,8 @@ protected: ValidateResults results; BSONObjBuilder output; - ASSERT_OK( - CollectionValidation::validate(&_opCtx, _nss, options, _background, &results, &output)); + ASSERT_OK(CollectionValidation::validate( + &_opCtx, _nss, options, _background, &results, &output, kTurnOnExtraLoggingForTest)); // Check if errors are reported if and only if valid is set to false. ASSERT_EQ(results.valid, results.errors.empty()); @@ -1209,7 +1212,8 @@ public: CollectionValidation::ValidateOptions::kFullValidation, _background, &results, - &output)); + &output, + kTurnOnExtraLoggingForTest)); auto dumpOnErrorGuard = makeGuard([&] { StorageDebugUtil::printValidateResults(results); @@ -1331,7 +1335,8 @@ public: CollectionValidation::ValidateOptions::kFullValidation, _background, &results, - &output)); + &output, + kTurnOnExtraLoggingForTest)); auto dumpOnErrorGuard = makeGuard([&] { StorageDebugUtil::printValidateResults(results); @@ -1429,7 +1434,8 @@ public: CollectionValidation::ValidateOptions::kFullValidation, _background, &results, - &output)); + &output, + kTurnOnExtraLoggingForTest)); auto dumpOnErrorGuard = makeGuard([&] { StorageDebugUtil::printValidateResults(results); |