diff options
author | Jonathan Abrahams <jonathan@mongodb.com> | 2016-04-06 14:01:54 -0400 |
---|---|---|
committer | Jonathan Abrahams <jonathan@mongodb.com> | 2016-04-06 14:01:54 -0400 |
commit | c18c47fa9ea0d1215fe83b735e615a804c0aad62 (patch) | |
tree | 5fb7a0066d67299fb40ac843c1b995140d544960 /jstests/concurrency/fsm_libs/runner.js | |
parent | 4241beaae04b38b3cd5163a715f516c771fb2d0b (diff) | |
download | mongo-c18c47fa9ea0d1215fe83b735e615a804c0aad62.tar.gz |
SERVER-23492 Add explicit execution mode serial to concurrency test suite
Diffstat (limited to 'jstests/concurrency/fsm_libs/runner.js')
-rw-r--r-- | jstests/concurrency/fsm_libs/runner.js | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/jstests/concurrency/fsm_libs/runner.js b/jstests/concurrency/fsm_libs/runner.js index e580a3891e0..4881676636d 100644 --- a/jstests/concurrency/fsm_libs/runner.js +++ b/jstests/concurrency/fsm_libs/runner.js @@ -11,7 +11,7 @@ load('jstests/concurrency/fsm_utils/setup_teardown_functions.js'); var runner = (function() { function validateExecutionMode(mode) { - var allowedKeys = ['composed', 'parallel']; + var allowedKeys = ['composed', 'parallel', 'serial']; Object.keys(mode).forEach(function(option) { assert.contains(option, @@ -26,8 +26,17 @@ var runner = (function() { mode.parallel = mode.parallel || false; assert.eq('boolean', typeof mode.parallel); - assert(!mode.composed || !mode.parallel, - "properties 'composed' and 'parallel' cannot both be true"); + mode.serial = mode.serial || false; + assert.eq('boolean', typeof mode.serial); + + var numEnabledModes = 0; + Object.keys(mode).forEach(key => { + if (mode[key]) { + numEnabledModes++; + } + }); + assert.eq( + 1, numEnabledModes, "One and only one execution mode can be enabled " + tojson(mode)); return mode; } @@ -134,7 +143,7 @@ var runner = (function() { * executed simultaneously, followed by workloads #2 and #3 together. */ function scheduleWorkloads(workloads, executionMode, executionOptions) { - if (!executionMode.composed && !executionMode.parallel) { // serial execution + if (executionMode.serial) { return Array.shuffle(workloads).map(function(workload) { return [workload]; // run each workload by itself }); @@ -742,7 +751,8 @@ var runner = (function() { executionOptions = executionOptions || {}; cleanupOptions = cleanupOptions || {}; - runWorkloads(workloads, clusterOptions, {}, executionOptions, cleanupOptions); + runWorkloads( + workloads, clusterOptions, {serial: true}, executionOptions, cleanupOptions); }, parallel: function parallel(workloads, clusterOptions, executionOptions, cleanupOptions) { |