summaryrefslogtreecommitdiff
path: root/jstests/concurrency/fsm_libs/resmoke_runner.js
diff options
context:
space:
mode:
authorRobert Guo <robert.guo@10gen.com>2018-04-11 11:05:13 -0400
committerRobert Guo <robert.guo@10gen.com>2018-04-30 09:56:57 -0400
commit39622745cd5258d40924c8e44be73b5c2e1b4ca4 (patch)
treecfb986e14083c3736747ced43246e92fa51978b0 /jstests/concurrency/fsm_libs/resmoke_runner.js
parent0b04f8bab03c64477b6ffd60fcd1c592dd4ca2b1 (diff)
downloadmongo-39622745cd5258d40924c8e44be73b5c2e1b4ca4.tar.gz
SERVER-19630 allow FSM tests to connect to an existing cluster
Diffstat (limited to 'jstests/concurrency/fsm_libs/resmoke_runner.js')
-rw-r--r--jstests/concurrency/fsm_libs/resmoke_runner.js31
1 files changed, 29 insertions, 2 deletions
diff --git a/jstests/concurrency/fsm_libs/resmoke_runner.js b/jstests/concurrency/fsm_libs/resmoke_runner.js
index d94fd4e31cc..3187a16bc05 100644
--- a/jstests/concurrency/fsm_libs/resmoke_runner.js
+++ b/jstests/concurrency/fsm_libs/resmoke_runner.js
@@ -174,7 +174,19 @@
clusterOptions.replication.enabled = true;
clusterOptions.replication.numNodes = topology.nodes.length;
} else if (topology.type === Topology.kShardedCluster) {
- throw new Error("resmoke_runner.js doesn't currently support sharded clusters");
+ clusterOptions.replication.enabled = TestData.usingReplicaSetShards || false;
+ clusterOptions.sharded.enabled = true;
+ clusterOptions.sharded.enableAutoSplit =
+ TestData.hasOwnProperty('runningWithAutoSplit') ? TestData.runningWithAutoSplit : true;
+ clusterOptions.sharded.enableBalancer =
+ TestData.hasOwnProperty('runningWithBalancer') ? TestData.runningWithBalancer : true;
+ clusterOptions.sharded.numMongos = topology.mongos.nodes.length;
+ clusterOptions.sharded.numShards = Object.keys(topology.shards).length;
+ clusterOptions.sharded.stepdownOptions = {};
+ clusterOptions.sharded.stepdownOptions.configStepdown =
+ TestData.runningWithConfigStepdowns || false;
+ clusterOptions.sharded.stepdownOptions.shardStepdown =
+ TestData.runningWithShardStepdowns || false;
} else if (topology.type !== Topology.kStandalone) {
throw new Error('Unrecognized topology format: ' + tojson(topology));
}
@@ -184,5 +196,20 @@
workloads = [workloads];
}
- runWorkloads(workloads, {cluster: clusterOptions});
+ let sessionOptions = {};
+ if (TestData.runningWithCausalConsistency) {
+ sessionOptions = Object.assign(
+ sessionOptions, {causalConsistency: true, readPreference: {mode: 'secondary'}});
+ }
+ if (TestData.runningWithConfigStepdowns || TestData.runningWithShardStepdowns) {
+ sessionOptions = Object.assign(sessionOptions, {retryWrites: true});
+ }
+
+ const executionOptions = {dbNamePrefix: TestData.dbNamePrefix || ""};
+
+ if (Object.keys(sessionOptions).length > 0) {
+ executionOptions.sessionOptions = sessionOptions;
+ }
+
+ runWorkloads(workloads, {cluster: clusterOptions, execution: executionOptions});
})();