summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Fefer <ivan.fefer@mongodb.com>2022-11-29 13:38:21 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-11-29 14:16:21 +0000
commit5780eb7761504ed0f085216883d481461dc7a6cb (patch)
treecaba10bd0b9290c404757700d26f4146a820dff9
parent8d9e3c1ba0760e75b05181e59330e8fd7a79c6b1 (diff)
downloadmongo-5780eb7761504ed0f085216883d481461dc7a6cb.tar.gz
SERVER-71320 Check for binVersion and userRandomBinVersion in nodeOptions
-rw-r--r--src/mongo/shell/replsettest.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mongo/shell/replsettest.js b/src/mongo/shell/replsettest.js
index c3ce7394822..2f277870757 100644
--- a/src/mongo/shell/replsettest.js
+++ b/src/mongo/shell/replsettest.js
@@ -2751,13 +2751,14 @@ var ReplSetTest = function(opts) {
defaults.serverless = true;
}
- if (options && options.binVersion &&
- jsTest.options().useRandomBinVersionsWithinReplicaSet) {
+ const nodeOptions = this.nodeOptions["n" + n];
+ const hasBinVersion =
+ (options && options.binVersion) || (nodeOptions && nodeOptions.binVersion);
+ if (hasBinVersion && jsTest.options().useRandomBinVersionsWithinReplicaSet) {
throw new Error(
"Can only specify one of binVersion and useRandomBinVersionsWithinReplicaSet, not both.");
}
- //
// Note : this replaces the binVersion of the shared startSet() options the first time
// through, so the full set is guaranteed to have different versions if size > 1. If using
// start() independently, independent version choices will be made
@@ -2778,7 +2779,7 @@ var ReplSetTest = function(opts) {
} else {
baseOptions = defaults;
}
- baseOptions = Object.merge(baseOptions, this.nodeOptions["n" + n]);
+ baseOptions = Object.merge(baseOptions, nodeOptions);
options = Object.merge(baseOptions, options);
if (options.hasOwnProperty("rsConfig")) {
this.nodeOptions["n" + n] =