summaryrefslogtreecommitdiff
path: root/jstests/hooks/run_fuzzer_restore_settings.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/hooks/run_fuzzer_restore_settings.js')
-rw-r--r--jstests/hooks/run_fuzzer_restore_settings.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/jstests/hooks/run_fuzzer_restore_settings.js b/jstests/hooks/run_fuzzer_restore_settings.js
index a2858f4e915..3a8318ea2bd 100644
--- a/jstests/hooks/run_fuzzer_restore_settings.js
+++ b/jstests/hooks/run_fuzzer_restore_settings.js
@@ -1,15 +1,25 @@
(function() {
'use strict';
-assert.commandWorked(db.adminCommand({setParameter: 1, requireApiVersion: false, apiVersion: "1"}));
+// Ignore "attempted to set unrecognized parameter" error from setParameter on old versions
+let res;
+try {
+ res = db.adminCommand({setParameter: 1, requireApiVersion: false, apiVersion: "1"});
+} catch (e) {
+ print("Failed to set requireApiVersion.");
+ print(e);
+}
+if (res && res.ok === 0 && !res.errmsg.includes("attempted to set unrecognized parameter")) {
+ assert.commandWorked(res);
+}
// Unsetting read/write settings. This command will also cause the server to refresh and get
-// the new settings. A standalone or mongos will return an error; ignore it.
+// the new settings. A standalone, mongos or old version will return an error; ignore it.
const result = db.adminCommand({
setDefaultRWConcern: 1,
defaultReadConcern: {},
defaultWriteConcern: {},
writeConcern: {w: 1}
});
-assert.commandWorkedOrFailedWithCode(result, [51300, 51301]);
+assert.commandWorkedOrFailedWithCode(result, [51300, 51301, 40415]);
})();