summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRui Liu <rui.liu@mongodb.com>2022-01-04 11:44:51 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-01-04 12:11:11 +0000
commit91f54cc887710ccc6e91c96d82274a66c811b8c9 (patch)
tree9511f3b7cd07f86af9ddebb5c0cec569d1f0fea7
parenta9216c8728dc0f3f596db071031914978e2e8e08 (diff)
downloadmongo-91f54cc887710ccc6e91c96d82274a66c811b8c9.tar.gz
SERVER-62319 Allow different errors thrown by different collMod implementation
-rw-r--r--jstests/core/hidden_index.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/jstests/core/hidden_index.js b/jstests/core/hidden_index.js
index 838d99fb71c..2a2658da116 100644
--- a/jstests/core/hidden_index.js
+++ b/jstests/core/hidden_index.js
@@ -98,9 +98,10 @@ assert.eq(idxSpec.hidden, true);
// Can't hide any index in a system collection.
const systemColl = db.getSiblingDB('admin').system.version;
assert.commandWorked(systemColl.createIndex({a: 1}));
-assert.commandFailedWithCode(
- systemColl.hideIndex("a_1"),
- FixtureHelpers.isMongos(db) ? ErrorCodes.NoShardingEnabled : ErrorCodes.BadValue);
+// The collMod command throws NoShardingEnabled on DDL coordinator implementation and BadValue on
+// old implementation.
+assert.commandFailedWithCode(systemColl.hideIndex("a_1"),
+ [ErrorCodes.NoShardingEnabled, ErrorCodes.BadValue]);
assert.commandFailedWithCode(systemColl.createIndex({a: 1}, {hidden: true}), 2);
// Can't hide the '_id' index.