summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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.