summaryrefslogtreecommitdiff
path: root/src/mongo/db/service_context_d_test_fixture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/service_context_d_test_fixture.cpp')
-rw-r--r--src/mongo/db/service_context_d_test_fixture.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/mongo/db/service_context_d_test_fixture.cpp b/src/mongo/db/service_context_d_test_fixture.cpp
index 8c0b6b8abf5..a0b8caab275 100644
--- a/src/mongo/db/service_context_d_test_fixture.cpp
+++ b/src/mongo/db/service_context_d_test_fixture.cpp
@@ -90,6 +90,9 @@ ServiceContextMongoDTest::ServiceContextMongoDTest(std::string engine, RepairAct
IndexAccessMethodFactory::set(serviceContext, std::make_unique<IndexAccessMethodFactoryImpl>());
Collection::Factory::set(serviceContext, std::make_unique<CollectionImpl::FactoryImpl>());
IndexBuildsCoordinator::set(serviceContext, std::make_unique<IndexBuildsCoordinatorMongod>());
+ CollectionShardingStateFactory::set(
+ getServiceContext(),
+ std::make_unique<CollectionShardingStateFactoryShard>(getServiceContext()));
}
ServiceContextMongoDTest::~ServiceContextMongoDTest() {
@@ -107,14 +110,6 @@ ServiceContextMongoDTest::~ServiceContextMongoDTest() {
std::swap(storageGlobalParams.repair, _stashedStorageParams.repair);
}
-void ServiceContextMongoDTest::setUp() {
- ServiceContextTest::setUp();
-
- CollectionShardingStateFactory::set(
- getServiceContext(),
- std::make_unique<CollectionShardingStateFactoryShard>(getServiceContext()));
-}
-
void ServiceContextMongoDTest::tearDown() {
{
// Some tests set the current OperationContext but do not release it until destruction.