summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2021-11-01 14:45:28 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-11-01 15:19:49 +0000
commit37d7d7041acf6bd7d32323ca84668061cdb1147b (patch)
tree106684946598076a044109815529d8091177c964 /jstests/noPassthrough
parent4a2038826d71171cf4f1fa1ec5afc01697d36b1f (diff)
downloadmongo-37d7d7041acf6bd7d32323ca84668061cdb1147b.tar.gz
SERVER-60179 The 'validate' command should return 'InvalidOptions' instead of 'CommandNotSupported' for incompatible options
Diffstat (limited to 'jstests/noPassthrough')
-rw-r--r--jstests/noPassthrough/background_validation_repl.js2
-rw-r--r--jstests/noPassthrough/validate_detects_invalid_index_options.js8
2 files changed, 5 insertions, 5 deletions
diff --git a/jstests/noPassthrough/background_validation_repl.js b/jstests/noPassthrough/background_validation_repl.js
index 8d3eb39e8f2..673e7e79a2c 100644
--- a/jstests/noPassthrough/background_validation_repl.js
+++ b/jstests/noPassthrough/background_validation_repl.js
@@ -60,7 +60,7 @@ const doTest = replSet => {
* Ensure {full:true} and {background:true} cannot be run together.
*/
assert.commandFailedWithCode(testColl.validate({background: true, full: true}),
- ErrorCodes.CommandNotSupported);
+ ErrorCodes.InvalidOptions);
assert.commandWorked(testDB.adminCommand({fsync: 1}));
diff --git a/jstests/noPassthrough/validate_detects_invalid_index_options.js b/jstests/noPassthrough/validate_detects_invalid_index_options.js
index c8a3e495bb0..98ae6130209 100644
--- a/jstests/noPassthrough/validate_detects_invalid_index_options.js
+++ b/jstests/noPassthrough/validate_detects_invalid_index_options.js
@@ -43,14 +43,14 @@ checkLog.containsJson(conn, 5980501);
// foreground validation on the ephemeralForTest storage engine, making it incompatible with this
// test.
assert.commandFailedWithCode(db.runCommand({validate: collName, metadata: true, background: true}),
- ErrorCodes.CommandNotSupported);
+ ErrorCodes.InvalidOptions);
assert.commandFailedWithCode(db.runCommand({validate: collName, metadata: true, repair: true}),
- ErrorCodes.CommandNotSupported);
+ ErrorCodes.InvalidOptions);
assert.commandFailedWithCode(db.runCommand({validate: collName, metadata: true, full: true}),
- ErrorCodes.CommandNotSupported);
+ ErrorCodes.InvalidOptions);
assert.commandFailedWithCode(
db.runCommand({validate: collName, metadata: true, enforceFastCount: true}),
- ErrorCodes.CommandNotSupported);
+ ErrorCodes.InvalidOptions);
// Drop the index with the invalid index options and validate only the metadata.
assert.commandWorked(coll.dropIndex({x: 1}));