summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Russotto <matthew.russotto@10gen.com>2017-11-09 16:32:54 -0500
committerMatthew Russotto <matthew.russotto@10gen.com>2017-11-09 16:33:35 -0500
commit38bf667b60a3fd05b98ff01b09c51b05dd024780 (patch)
tree51c3195cb5ef92a274c6ed1a5753ea64731f3add
parent862958d49fc7c19d2d74a5e1ad25c3a5c4a4cd16 (diff)
downloadmongo-38bf667b60a3fd05b98ff01b09c51b05dd024780.tar.gz
SERVER-31218 Test must wait for slave to sync FCV document before using FCV 3.6 commands.
-rw-r--r--jstests/noPassthrough/unsupported_change_stream_deployments.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/jstests/noPassthrough/unsupported_change_stream_deployments.js b/jstests/noPassthrough/unsupported_change_stream_deployments.js
index 0213eab3f2b..82a497bf19b 100644
--- a/jstests/noPassthrough/unsupported_change_stream_deployments.js
+++ b/jstests/noPassthrough/unsupported_change_stream_deployments.js
@@ -4,6 +4,7 @@
load("jstests/aggregation/extras/utils.js"); // For assertErrorCode.
// For supportsMajorityReadConcern().
load("jstests/multiVersion/libs/causal_consistency_helpers.js");
+ load("jstests/libs/feature_compatibility_version.js"); // For checkFCV.
if (!supportsMajorityReadConcern()) {
jsTestLog("Skipping test since storage engine doesn't support majority read concern.");
@@ -28,9 +29,12 @@
const masterSlaveFixture = new ReplTest("change_stream");
const master = masterSlaveFixture.start(true, {enableMajorityReadConcern: ""});
assertChangeStreamNotSupportedOnConnection(master);
- // Slaves start in the wrong FCV, (SERVER-31218) resulting in the wrong error code.
- // const slave = masterSlaveFixture.start(false);
- // assertChangeStreamNotSupportedOnConnection(slave);
+
+ const slave = masterSlaveFixture.start(false);
+ // Slaves start in FCV 3.4; we need to wait for it to sync the FCV document from the master
+ // before trying a change stream, or the change stream will fail for the wrong reason.
+ assert.soonNoExcept(() => checkFCV(slave.getDB("admin"), "3.6") || true);
+ assertChangeStreamNotSupportedOnConnection(slave);
// Test a sharded cluster with standalone shards.
const clusterWithStandalones = new ShardingTest(