summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/vector_clock_config_server_test.cpp
diff options
context:
space:
mode:
authorKevin Pulo <kevin.pulo@mongodb.com>2020-06-10 18:00:24 +1000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-06-11 01:23:55 +0000
commitdba968473d0b4dd3e8c7b31e524d3e8ed20bf6ae (patch)
tree3e170f8e2d898f1782420a54df9644514397e7cc /src/mongo/db/s/vector_clock_config_server_test.cpp
parentc08a726e61157ae501c28cf7e222e16d49954fbf (diff)
downloadmongo-dba968473d0b4dd3e8c7b31e524d3e8ed20bf6ae.tar.gz
SERVER-48683 VectorClockConfigServerTest should use DistLockManagerMock
Diffstat (limited to 'src/mongo/db/s/vector_clock_config_server_test.cpp')
-rw-r--r--src/mongo/db/s/vector_clock_config_server_test.cpp10
1 files changed, 10 insertions, 0 deletions
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.
*/