summaryrefslogtreecommitdiff
path: root/buildscripts
diff options
context:
space:
mode:
authorEddie Louie <eddie.louie@mongodb.com>2017-03-26 21:53:16 -0400
committerEddie Louie <eddie.louie@mongodb.com>2017-03-27 16:57:58 -0400
commitbc5c3286fba8cdb40fa6b2c195712075e3a05a1f (patch)
tree19792abb305b473fb70cd0fc148e80ecb202ba98 /buildscripts
parent465bd234f7931ced4ab2d4ee12e9d0274b5910d6 (diff)
downloadmongo-bc5c3286fba8cdb40fa6b2c195712075e3a05a1f.tar.gz
SERVER-26224 Add --staggerJobs option to resmoke.py
Diffstat (limited to 'buildscripts')
-rw-r--r--buildscripts/resmokelib/config.py4
-rw-r--r--buildscripts/resmokelib/parser.py10
-rw-r--r--buildscripts/resmokelib/testing/executor.py3
3 files changed, 15 insertions, 2 deletions
diff --git a/buildscripts/resmokelib/config.py b/buildscripts/resmokelib/config.py
index a3e207f8e2b..b3ff831669a 100644
--- a/buildscripts/resmokelib/config.py
+++ b/buildscripts/resmokelib/config.py
@@ -55,6 +55,7 @@ DEFAULTS = {
"shellReadMode": None,
"shellWriteMode": None,
"shuffle": False,
+ "staggerJobs": None,
"storageEngine": None,
"storageEngineCacheSizeGB": None,
"taskId": None,
@@ -145,6 +146,9 @@ SHELL_WRITE_MODE = None
# alphabetical (case-insensitive) order.
SHUFFLE = None
+# If true, the launching of jobs is staggered in resmoke.py.
+STAGGER_JOBS = None
+
# If set, then all mongod's started by resmoke.py and by the mongo shell will use the specified
# storage engine.
STORAGE_ENGINE = None
diff --git a/buildscripts/resmokelib/parser.py b/buildscripts/resmokelib/parser.py
index 8b53ab12a63..2e981fab4d1 100644
--- a/buildscripts/resmokelib/parser.py
+++ b/buildscripts/resmokelib/parser.py
@@ -41,6 +41,7 @@ DEST_TO_CONFIG = {
"shell_read_mode": "shellReadMode",
"shell_write_mode": "shellWriteMode",
"shuffle": "shuffle",
+ "stagger_jobs": "staggerJobs",
"storage_engine": "storageEngine",
"storage_engine_cache_size": "storageEngineCacheSizeGB",
"task_id": "taskId",
@@ -182,6 +183,11 @@ def parse_command_line():
parser.add_option("--shuffle", action="store_true", dest="shuffle",
help="Randomize the order in which tests are executed.")
+ parser.add_option("--staggerJobs", type="choice", action="store", dest="stagger_jobs",
+ choices=("on", "off"), metavar="ON|OFF",
+ help=("Enable or disable the stagger of launching resmoke jobs."
+ " Defaults to %default."))
+
parser.add_option("--storageEngine", dest="storage_engine", metavar="ENGINE",
help="The storage engine used by dbtests and jstests.")
@@ -206,7 +212,8 @@ def parse_command_line():
dry_run="off",
find_suites=False,
list_suites=False,
- prealloc_journal="off")
+ prealloc_journal="off",
+ stagger_jobs="off")
return parser.parse_args()
@@ -252,6 +259,7 @@ def update_config_vars(values):
_config.SHELL_READ_MODE = config.pop("shellReadMode")
_config.SHELL_WRITE_MODE = config.pop("shellWriteMode")
_config.SHUFFLE = config.pop("shuffle")
+ _config.STAGGER_JOBS = config.pop("staggerJobs") == "on"
_config.STORAGE_ENGINE = config.pop("storageEngine")
_config.STORAGE_ENGINE_CACHE_SIZE = config.pop("storageEngineCacheSizeGB")
_config.TASK_ID = config.pop("taskId")
diff --git a/buildscripts/resmokelib/testing/executor.py b/buildscripts/resmokelib/testing/executor.py
index 1ea67a4dfbe..d14a5e563f3 100644
--- a/buildscripts/resmokelib/testing/executor.py
+++ b/buildscripts/resmokelib/testing/executor.py
@@ -167,7 +167,8 @@ class TestGroupExecutor(object):
threads.append(t)
# SERVER-24729 Need to stagger when jobs start to reduce I/O load if there
# are many of them. Both the 5 and the 10 are arbitrary.
- if len(threads) >= 5:
+ # Currently only enabled on Evergreen.
+ if _config.STAGGER_JOBS and len(threads) >= 5:
time.sleep(10)
joined = False