summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2020-02-19 10:16:17 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-19 15:27:49 +0000
commitbc71c1dfefb4da9ba6592005ce35e21456ca7af3 (patch)
tree37c59dfdea797e79d053f4afe07215dee3de92a1 /src/mongo/db
parentb77010cab2386a58e05b6ffaa04921c43578467c (diff)
downloadmongo-bc71c1dfefb4da9ba6592005ce35e21456ca7af3.tar.gz
SERVER-39453 add StorageEngineMock to initial sync tests for IndexBuildsCoordinator
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/repl/cloner_test_fixture.cpp4
-rw-r--r--src/mongo/db/repl/initial_syncer_test.cpp4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/db/repl/cloner_test_fixture.cpp b/src/mongo/db/repl/cloner_test_fixture.cpp
index d6e213209a1..0f154bbf3dc 100644
--- a/src/mongo/db/repl/cloner_test_fixture.cpp
+++ b/src/mongo/db/repl/cloner_test_fixture.cpp
@@ -34,6 +34,7 @@
#include "mongo/db/repl/storage_interface.h"
#include "mongo/db/repl/storage_interface_mock.h"
#include "mongo/db/service_context_test_fixture.h"
+#include "mongo/db/storage/storage_engine_mock.h"
#include "mongo/dbtests/mock/mock_dbclient_connection.h"
#include "mongo/logger/logger.h"
#include "mongo/unittest/unittest.h"
@@ -74,6 +75,9 @@ void ClonerTestFixture::setUp() {
kInitialRollbackId,
Days(1),
&_clock);
+
+ // Required by CollectionCloner::listIndexesStage() and IndexBuildsCoordinator.
+ getServiceContext()->setStorageEngine(std::make_unique<StorageEngineMock>());
}
void ClonerTestFixture::tearDown() {
diff --git a/src/mongo/db/repl/initial_syncer_test.cpp b/src/mongo/db/repl/initial_syncer_test.cpp
index d8c4bdfe139..3fd72c2aef4 100644
--- a/src/mongo/db/repl/initial_syncer_test.cpp
+++ b/src/mongo/db/repl/initial_syncer_test.cpp
@@ -59,6 +59,7 @@
#include "mongo/db/repl/task_executor_mock.h"
#include "mongo/db/repl/update_position_args.h"
#include "mongo/db/service_context_test_fixture.h"
+#include "mongo/db/storage/storage_engine_mock.h"
#include "mongo/executor/network_interface_mock.h"
#include "mongo/executor/thread_pool_task_executor_test_fixture.h"
#include "mongo/platform/mutex.h"
@@ -339,6 +340,9 @@ protected:
_dbWorkThreadPool = std::make_unique<ThreadPool>(dbThreadPoolOptions);
_dbWorkThreadPool->startup();
+ // Required by CollectionCloner::listIndexesStage() and IndexBuildsCoordinator.
+ service->setStorageEngine(std::make_unique<StorageEngineMock>());
+
_target = HostAndPort{"localhost:12346"};
_mockServer = std::make_unique<MockRemoteDBServer>(_target.toString());
// Usually we're just skipping the cloners in this test, so we provide an empty list