summaryrefslogtreecommitdiff
path: root/src/mongo/s/catalog/sharding_catalog_client_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/catalog/sharding_catalog_client_test.cpp')
-rw-r--r--src/mongo/s/catalog/sharding_catalog_client_test.cpp50
1 files changed, 8 insertions, 42 deletions
diff --git a/src/mongo/s/catalog/sharding_catalog_client_test.cpp b/src/mongo/s/catalog/sharding_catalog_client_test.cpp
index 80967107ff6..1c9e8bca3b9 100644
--- a/src/mongo/s/catalog/sharding_catalog_client_test.cpp
+++ b/src/mongo/s/catalog/sharding_catalog_client_test.cpp
@@ -361,40 +361,6 @@ TEST_F(ShardingCatalogClientTest, GetAllShardsWithInvalidShard) {
future.default_timed_get();
}
-TEST_F(ShardingCatalogClientTest, GetAllShardsWithDrainingShard) {
- configTargeter()->setFindHostReturnValue(HostAndPort("TestHost1"));
-
- auto future = launchAsync([this]() {
- const auto shards =
- assertGet(catalogClient()->getAllShards(operationContext(),
- repl::ReadConcernLevel::kMajorityReadConcern,
- true /* excludeDraining */));
- return shards.value;
- });
-
- onFindCommand([this](const RemoteCommandRequest& request) {
- ASSERT_BSONOBJ_EQ(getReplSecondaryOkMetadata(),
- rpc::TrackingMetadata::removeTrackingData(request.metadata));
-
- const auto opMsg = OpMsgRequest::fromDBAndBody(request.dbname, request.cmdObj);
- const auto query = query_request_helper::makeFromFindCommandForTests(opMsg.body);
-
- ASSERT_EQ(query->getNamespaceOrUUID().nss().value_or(NamespaceString()),
- ShardType::ConfigNS);
- ASSERT_BSONOBJ_EQ(query->getFilter(), BSON(ShardType::draining.ne(true)));
- ASSERT_BSONOBJ_EQ(query->getSort(), BSONObj());
- ASSERT_FALSE(query->getLimit().has_value());
-
- checkReadConcern(request.cmdObj,
- VectorClock::kInitialComponentTime.asTimestamp(),
- repl::OpTime::kUninitializedTerm);
-
- return vector<BSONObj>{};
- });
-
- future.default_timed_get();
-}
-
TEST_F(ShardingCatalogClientTest, GetChunksForNSWithSortAndLimit) {
configTargeter()->setFindHostReturnValue(HostAndPort("TestHost1"));
@@ -1385,10 +1351,10 @@ TEST_F(ShardingCatalogClientTest, GetNewKeys) {
repl::ReadConcernLevel readConcernLevel(repl::ReadConcernLevel::kMajorityReadConcern);
auto future = launchAsync([this, purpose, currentTime, readConcernLevel] {
- auto swKeys = catalogClient()->getNewInternalKeys(
- operationContext(), purpose, currentTime, readConcernLevel);
- ASSERT_OK(swKeys.getStatus());
- return swKeys.getValue();
+ auto status =
+ catalogClient()->getNewKeys(operationContext(), purpose, currentTime, readConcernLevel);
+ ASSERT_OK(status.getStatus());
+ return status.getValue();
});
LogicalTime dummyTime(Timestamp(9876, 5432));
@@ -1450,10 +1416,10 @@ TEST_F(ShardingCatalogClientTest, GetNewKeysWithEmptyCollection) {
repl::ReadConcernLevel readConcernLevel(repl::ReadConcernLevel::kMajorityReadConcern);
auto future = launchAsync([this, purpose, currentTime, readConcernLevel] {
- auto swKeys = catalogClient()->getNewInternalKeys(
- operationContext(), purpose, currentTime, readConcernLevel);
- ASSERT_OK(swKeys.getStatus());
- return swKeys.getValue();
+ auto status =
+ catalogClient()->getNewKeys(operationContext(), purpose, currentTime, readConcernLevel);
+ ASSERT_OK(status.getStatus());
+ return status.getValue();
});
onFindCommand([this](const RemoteCommandRequest& request) {