diff options
Diffstat (limited to 'src/mongo/s/config_server_test_fixture.cpp')
-rw-r--r-- | src/mongo/s/config_server_test_fixture.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/mongo/s/config_server_test_fixture.cpp b/src/mongo/s/config_server_test_fixture.cpp index 90b815c9eaf..22bc7ac4ccb 100644 --- a/src/mongo/s/config_server_test_fixture.cpp +++ b/src/mongo/s/config_server_test_fixture.cpp @@ -123,6 +123,9 @@ void ConfigServerTestFixture::setUp() { _addShardNetworkTestEnv = stdx::make_unique<NetworkTestEnv>(_executorForAddShard, _mockNetworkForAddShard); + CatalogCacheLoader::set(getServiceContext(), + stdx::make_unique<ConfigServerCatalogCacheLoader>()); + uassertStatusOK(initializeGlobalShardingStateForMongodForTest(ConnectionString::forLocal())); } @@ -133,6 +136,8 @@ void ConfigServerTestFixture::tearDown() { ShardingCatalogManager::clearForTests(getServiceContext()); + CatalogCacheLoader::clearForTests(getServiceContext()); + ShardingMongodTestFixture::tearDown(); } @@ -157,14 +162,8 @@ std::unique_ptr<ShardingCatalogClient> ConfigServerTestFixture::makeShardingCata return stdx::make_unique<ShardingCatalogClientImpl>(std::move(distLockManager)); } -std::unique_ptr<CatalogCacheLoader> ConfigServerTestFixture::makeCatalogCacheLoader() { - return stdx::make_unique<ConfigServerCatalogCacheLoader>(); -} - -std::unique_ptr<CatalogCache> ConfigServerTestFixture::makeCatalogCache( - std::unique_ptr<CatalogCacheLoader> catalogCacheLoader) { - invariant(catalogCacheLoader); - return stdx::make_unique<CatalogCache>(std::move(catalogCacheLoader)); +std::unique_ptr<CatalogCache> ConfigServerTestFixture::makeCatalogCache() { + return stdx::make_unique<CatalogCache>(CatalogCacheLoader::get(getServiceContext())); } std::unique_ptr<BalancerConfiguration> ConfigServerTestFixture::makeBalancerConfiguration() { |