summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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.