summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Guo <robert.guo@10gen.com>2018-08-09 18:04:02 -0400
committerRobert Guo <robert.guo@10gen.com>2018-08-23 15:22:31 -0400
commitf7ae3b339292ab3a8fbd25aaebf073383e299ae6 (patch)
tree95120c3e166f5c5335639c10f77708dd0b211a70
parent3088dd59c514f2d0a1dc123b62752008536c7bbf (diff)
downloadmongo-f7ae3b339292ab3a8fbd25aaebf073383e299ae6.tar.gz
SERVER-36129 awaitReplication after setup functions in concurrency
suites (cherry picked from commit 000436db8a0954ec52ee3f4596a3d61995b1fca8)
-rw-r--r--jstests/concurrency/fsm_libs/cluster.js7
-rw-r--r--jstests/concurrency/fsm_libs/resmoke_runner.js7
2 files changed, 14 insertions, 0 deletions
diff --git a/jstests/concurrency/fsm_libs/cluster.js b/jstests/concurrency/fsm_libs/cluster.js
index 330507a448d..3823449abe2 100644
--- a/jstests/concurrency/fsm_libs/cluster.js
+++ b/jstests/concurrency/fsm_libs/cluster.js
@@ -620,6 +620,13 @@ var Cluster = function(options) {
return this.shouldPerformContinuousStepdowns() &&
options.sharded.stepdownOptions.shardStepdown;
};
+
+ this.awaitReplication = () => {
+ assert(this.isReplication(), 'cluster does not contain replica sets');
+ for (let rst of replSets) {
+ rst.awaitReplication();
+ }
+ };
};
/**
diff --git a/jstests/concurrency/fsm_libs/resmoke_runner.js b/jstests/concurrency/fsm_libs/resmoke_runner.js
index 9ae7271c91d..409b588c4c6 100644
--- a/jstests/concurrency/fsm_libs/resmoke_runner.js
+++ b/jstests/concurrency/fsm_libs/resmoke_runner.js
@@ -98,6 +98,13 @@
cleanup.push(workload);
});
+ // Await replication after running the $config.setup() function when stepdowns are
+ // permitted to ensure its effects aren't rolled back.
+ if (cluster.isReplication() &&
+ typeof executionOptions.stepdownPermittedFile === 'string') {
+ cluster.awaitReplication();
+ }
+
// After the $config.setup() function has been called, it is safe for the stepdown
// thread to start running. The main thread won't attempt to interact with the cluster
// until all of the spawned worker threads have finished.