summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2016-09-23 11:26:55 -0400
committerDavid Storch <david.storch@10gen.com>2016-09-23 16:45:43 -0400
commit2009fc942491098a4bd17001a2278af471e3cb08 (patch)
treeebaf0efd4700ddb33d69c4996b846d43673d099b
parent8d4d108991e1e61e088c1d79155d830fc4acf2e2 (diff)
downloadmongo-2009fc942491098a4bd17001a2278af471e3cb08.tar.gz
SERVER-26260 make tests await replication of FCV before downgrade
-rw-r--r--jstests/multiVersion/downgrade_replset.js4
-rw-r--r--jstests/multiVersion/minor_version_downgrade_replset.js4
2 files changed, 8 insertions, 0 deletions
diff --git a/jstests/multiVersion/downgrade_replset.js b/jstests/multiVersion/downgrade_replset.js
index 8745343d1f7..a2f5a5346ba 100644
--- a/jstests/multiVersion/downgrade_replset.js
+++ b/jstests/multiVersion/downgrade_replset.js
@@ -31,7 +31,11 @@ var coll = "test.foo";
// do this prior to writing any data to the replica set so that any indexes created during this test
// are compatible with 3.2. This effectively allows us to emulate upgrading to the latest version
// with existing data files and then trying to downgrade back to 3.2.
+//
+// We wait for the feature compatibility version to be set to "3.2" on all nodes of the replica set
+// in order to ensure that all nodes can be successfully downgraded.
assert.commandWorked(primary.adminCommand({setFeatureCompatibilityVersion: "3.2"}));
+rst.awaitReplication();
jsTest.log("Inserting documents into collection.");
for (var i = 0; i < 10; i++) {
diff --git a/jstests/multiVersion/minor_version_downgrade_replset.js b/jstests/multiVersion/minor_version_downgrade_replset.js
index daa66e7d914..3dae0c0a23f 100644
--- a/jstests/multiVersion/minor_version_downgrade_replset.js
+++ b/jstests/multiVersion/minor_version_downgrade_replset.js
@@ -31,7 +31,11 @@ var coll = "test.foo";
// do this prior to writing any data to the replica set so that any indexes created during this test
// are compatible with 3.2. This effectively allows us to emulate upgrading to the latest version
// with existing data files and then trying to downgrade back to 3.2.
+//
+// We wait for the feature compatibility version to be set to "3.2" on all nodes of the replica set
+// in order to ensure that all nodes can be successfully downgraded.
assert.commandWorked(primary.adminCommand({setFeatureCompatibilityVersion: "3.2"}));
+rst.awaitReplication();
jsTest.log("Inserting documents into collection.");
for (var i = 0; i < 10; i++) {