summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/s/resharding/resharding_destined_recipient_test.cpp26
-rw-r--r--src/mongo/db/s/shard_server_test_fixture.cpp3
2 files changed, 12 insertions, 17 deletions
diff --git a/src/mongo/db/s/resharding/resharding_destined_recipient_test.cpp b/src/mongo/db/s/resharding/resharding_destined_recipient_test.cpp
index 28f10ae9143..653d99143f9 100644
--- a/src/mongo/db/s/resharding/resharding_destined_recipient_test.cpp
+++ b/src/mongo/db/s/resharding/resharding_destined_recipient_test.cpp
@@ -310,22 +310,18 @@ TEST_F(DestinedRecipientTest, TestGetDestinedRecipientThrowsOnBlockedRefresh) {
auto opCtx = operationContext();
auto env = setupReshardingEnv(opCtx, false);
- {
- AutoGetCollection coll(opCtx, kNss, MODE_IX);
- OperationShardingState::setShardRole(opCtx, kNss, env.version, env.dbVersion);
-
- FailPointEnableBlock failPoint("blockCollectionCacheLookup");
- ASSERT_THROWS_WITH_CHECK(ShardingWriteRouter(opCtx, kNss, Grid::get(opCtx)->catalogCache()),
- ShardCannotRefreshDueToLocksHeldException,
- [&](const ShardCannotRefreshDueToLocksHeldException& ex) {
- const auto refreshInfo =
- ex.extraInfo<ShardCannotRefreshDueToLocksHeldInfo>();
- ASSERT(refreshInfo);
- ASSERT_EQ(refreshInfo->getNss(), env.tempNss);
- });
- }
+ AutoGetCollection coll(opCtx, kNss, MODE_IX);
+ OperationShardingState::setShardRole(opCtx, kNss, env.version, env.dbVersion);
- auto sw = catalogCache()->getCollectionRoutingInfoWithRefresh(opCtx, env.tempNss);
+ FailPointEnableBlock failPoint("blockCollectionCacheLookup");
+ ASSERT_THROWS_WITH_CHECK(ShardingWriteRouter(opCtx, kNss, Grid::get(opCtx)->catalogCache()),
+ ShardCannotRefreshDueToLocksHeldException,
+ [&](const ShardCannotRefreshDueToLocksHeldException& ex) {
+ const auto refreshInfo =
+ ex.extraInfo<ShardCannotRefreshDueToLocksHeldInfo>();
+ ASSERT(refreshInfo);
+ ASSERT_EQ(refreshInfo->getNss(), env.tempNss);
+ });
}
TEST_F(DestinedRecipientTest, TestOpObserverSetsDestinedRecipientOnInserts) {
diff --git a/src/mongo/db/s/shard_server_test_fixture.cpp b/src/mongo/db/s/shard_server_test_fixture.cpp
index fe4de75a820..05bd61a4022 100644
--- a/src/mongo/db/s/shard_server_test_fixture.cpp
+++ b/src/mongo/db/s/shard_server_test_fixture.cpp
@@ -85,9 +85,8 @@ void ShardServerTestFixture::setCatalogCacheLoader(std::unique_ptr<CatalogCacheL
}
void ShardServerTestFixture::tearDown() {
- CatalogCacheLoader::clearForTests(getServiceContext());
-
ShardingMongodTestFixture::tearDown();
+ CatalogCacheLoader::clearForTests(getServiceContext());
}
std::unique_ptr<ShardingCatalogClient> ShardServerTestFixture::makeShardingCatalogClient() {