summaryrefslogtreecommitdiff
path: root/jstests/sharding/collection_uuid_coll_stats_index_stats.js
diff options
context:
space:
mode:
authorGregory Noma <gregory.noma@gmail.com>2022-02-10 00:55:18 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-02-10 01:24:48 +0000
commit755faabbd45050d4bd0567d5c523bd115ea37b84 (patch)
tree2aba2b27d7beb0e96ab782d30d63d8108d1ebd1f /jstests/sharding/collection_uuid_coll_stats_index_stats.js
parentfdf2fc77653d05550f7f8a55e54f865ed008bbdc (diff)
downloadmongo-755faabbd45050d4bd0567d5c523bd115ea37b84.tar.gz
SERVER-62862 Add `expectedNamespace` to `CollectionUUIDMismatch` error response
Diffstat (limited to 'jstests/sharding/collection_uuid_coll_stats_index_stats.js')
-rw-r--r--jstests/sharding/collection_uuid_coll_stats_index_stats.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/jstests/sharding/collection_uuid_coll_stats_index_stats.js b/jstests/sharding/collection_uuid_coll_stats_index_stats.js
index 13c479840b7..21cf74945b6 100644
--- a/jstests/sharding/collection_uuid_coll_stats_index_stats.js
+++ b/jstests/sharding/collection_uuid_coll_stats_index_stats.js
@@ -9,8 +9,9 @@
load("jstests/libs/write_concern_util.js"); // For 'shardCollectionWithChunks'
-const validateErrorResponse = function(res, collectionUUID, actualNamespace) {
+const validateErrorResponse = function(res, collectionUUID, expectedNamespace, actualNamespace) {
assert.eq(res.collectionUUID, collectionUUID);
+ assert.eq(res.expectedNamespace, expectedNamespace);
assert.eq(res.actualNamespace, actualNamespace);
};
@@ -64,14 +65,16 @@ const testCommand = function(cmd, cmdObj) {
cmdObj["collectionUUID"] = sameShardUUID;
let res =
assert.commandFailedWithCode(testDB.runCommand(cmdObj), ErrorCodes.CollectionUUIDMismatch);
- validateErrorResponse(res, sameShardUUID, sameShardColl.getFullName());
+ validateErrorResponse(
+ res, sameShardUUID, shardedCollection.getFullName(), sameShardColl.getFullName());
jsTestLog("If the aggregation command hits all shards, then it should return the " +
"actual namespace of the unsharded collection that has different primary shard.");
cmdObj["collectionUUID"] = otherShardUUID;
res =
assert.commandFailedWithCode(testDB.runCommand(cmdObj), ErrorCodes.CollectionUUIDMismatch);
- validateErrorResponse(res, otherShardUUID, otherShardColl.getFullName());
+ validateErrorResponse(
+ res, otherShardUUID, shardedCollection.getFullName(), otherShardColl.getFullName());
jsTestLog(
"If the aggregation command hits only one shards, then it can't find the actual namespace" +
@@ -81,7 +84,7 @@ const testCommand = function(cmd, cmdObj) {
cmdObj["collectionUUID"] = otherShardUUID;
res =
assert.commandFailedWithCode(testDB.runCommand(cmdObj), ErrorCodes.CollectionUUIDMismatch);
- validateErrorResponse(res, otherShardUUID, "");
+ validateErrorResponse(res, otherShardUUID, sameShardColl.getFullName(), "");
};
testCommand("aggregate", {aggregate: "", pipeline: [{$collStats: {latencyStats: {}}}], cursor: {}});