summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason Chan <jason.chan@mongodb.com>2019-10-21 18:58:03 +0000
committerevergreen <evergreen@mongodb.com>2019-10-21 18:58:03 +0000
commit5fac3f5e2dfacf25a6d4251d797bea7e0b808e97 (patch)
tree00569884823fe020882b25f257d09794f403b6dc /src
parent0dfbced1ee2eacba4189d727b1a0a17bc34f90a6 (diff)
downloadmongo-5fac3f5e2dfacf25a6d4251d797bea7e0b808e97.tar.gz
SERVER-44019 Change randomBinVersions to useRandomBinVersionsWithinReplicaSet in multiversion testing
Diffstat (limited to 'src')
-rw-r--r--src/mongo/shell/replsettest.js12
-rw-r--r--src/mongo/shell/utils.js12
2 files changed, 14 insertions, 10 deletions
diff --git a/src/mongo/shell/replsettest.js b/src/mongo/shell/replsettest.js
index 1531b620780..023ae601a81 100644
--- a/src/mongo/shell/replsettest.js
+++ b/src/mongo/shell/replsettest.js
@@ -579,7 +579,7 @@ var ReplSetTest = function(opts) {
var nodes = [];
- if (jsTest.options().randomBinVersions) {
+ if (jsTest.options().useRandomBinVersionsWithinReplicaSet) {
// Set the random seed to the value passed in by TestData. The seed is undefined
// by default.
Random.setRandomSeed(jsTest.options().seed);
@@ -1043,7 +1043,7 @@ var ReplSetTest = function(opts) {
isMultiversion = true;
}
});
- if (isMultiversion || jsTest.options().randomBinVersions) {
+ if (isMultiversion || jsTest.options().useRandomBinVersionsWithinReplicaSet) {
assert.commandWorked(
self.getPrimary().adminCommand({setFeatureCompatibilityVersion: lastStableFCV}));
checkFCV(self.getPrimary().getDB("admin"), lastStableFCV);
@@ -2351,8 +2351,10 @@ var ReplSetTest = function(opts) {
dbpath: "$set-$node"
};
- if (options && options.binVersion && jsTest.options().randomBinVersions) {
- throw new Error("Can only specify one of binVersion and randomBinVersion, not both.");
+ if (options && options.binVersion &&
+ jsTest.options().useRandomBinVersionsWithinReplicaSet) {
+ throw new Error(
+ "Can only specify one of binVersion and useRandomBinVersionsWithinReplicaSet, not both.");
}
//
@@ -2379,7 +2381,7 @@ var ReplSetTest = function(opts) {
}
delete options.rsConfig;
- if (jsTest.options().randomBinVersions) {
+ if (jsTest.options().useRandomBinVersionsWithinReplicaSet) {
const rand = Random.rand();
options.binVersion = rand < 0.5 ? "latest" : "last-stable";
print("Randomly assigned binary version: " + options.binVersion + " to node: " + n);
diff --git a/src/mongo/shell/utils.js b/src/mongo/shell/utils.js
index 33689f5f8b9..c3377a1254e 100644
--- a/src/mongo/shell/utils.js
+++ b/src/mongo/shell/utils.js
@@ -337,12 +337,14 @@ jsTestOptions = function() {
TestData.setSkipShardingPartsOfPrepareTransactionFailpoint || false,
roleGraphInvalidationIsFatal: TestData.roleGraphInvalidationIsFatal || false,
networkErrorAndTxnOverrideConfig: TestData.networkErrorAndTxnOverrideConfig || {},
- // When randomBinVersions is true, randomly assign the binary versions of each node
- // in the replica set to 'latest' or 'last-stable'.
+ // When useRandomBinVersionsWithinReplicaSet is true, randomly assign the binary
+ // versions of each node in the replica set to 'latest' or 'last-stable'.
// This flag is currently a placeholder and only sets the replica set to last-stable
- // FCV. Randomized behavior will be implemented as part of SERVER-42774.
- randomBinVersions: TestData.randomBinVersions || false,
- // Set a specific random seed to be used when randomBinVersions is true.
+ // FCV.
+ useRandomBinVersionsWithinReplicaSet:
+ TestData.useRandomBinVersionsWithinReplicaSet || false,
+ // Set a specific random seed to be used when useRandomBinVersionsWithinReplicaSet is
+ // true.
seed: TestData.seed || undefined,
});
}