diff options
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/s/SConscript | 1 | ||||
-rw-r--r-- | src/mongo/db/s/vector_clock_config_server_test.cpp | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/mongo/db/s/SConscript b/src/mongo/db/s/SConscript index fb555cb1171..e6f46132f70 100644 --- a/src/mongo/db/s/SConscript +++ b/src/mongo/db/s/SConscript @@ -368,6 +368,7 @@ env.CppUnitTest( LIBDEPS=[ '$BUILD_DIR/mongo/db/auth/authmocks', '$BUILD_DIR/mongo/db/auth/authmocks', + '$BUILD_DIR/mongo/s/catalog/dist_lock_manager_mock', '$BUILD_DIR/mongo/s/config_server_test_fixture', '$BUILD_DIR/mongo/s/sharding_router_test_fixture', 'chunk_splitter', diff --git a/src/mongo/db/s/vector_clock_config_server_test.cpp b/src/mongo/db/s/vector_clock_config_server_test.cpp index 6c62f4834ac..e6b1a4d2bb3 100644 --- a/src/mongo/db/s/vector_clock_config_server_test.cpp +++ b/src/mongo/db/s/vector_clock_config_server_test.cpp @@ -33,6 +33,7 @@ #include "mongo/db/keys_collection_manager.h" #include "mongo/db/logical_time_validator.h" #include "mongo/db/vector_clock_mutable.h" +#include "mongo/s/catalog/dist_lock_manager_mock.h" #include "mongo/s/config_server_test_fixture.h" #include "mongo/unittest/death_test.h" #include "mongo/unittest/unittest.h" @@ -68,6 +69,15 @@ protected: ConfigServerTestFixture::tearDown(); } + // The VectorClock tests assume nothing else ticks ClusterTime. However, + // ConfigServerTestFixture installs an actual DistLockManager, which does writes (thereby + // ticking ClusterTime). So for these tests, that is overridden to be a mock. + std::unique_ptr<DistLockManager> makeDistLockManager( + std::unique_ptr<DistLockCatalog> distLockCatalog) override { + invariant(distLockCatalog); + return std::make_unique<DistLockManagerMock>(std::move(distLockCatalog)); + } + /** * Forces KeyManager to refresh cache and generate new keys. */ |