summaryrefslogtreecommitdiff
path: root/buildscripts
diff options
context:
space:
mode:
authorMaria van Keulen <maria@mongodb.com>2019-05-02 15:15:17 -0400
committerMaria van Keulen <maria@mongodb.com>2019-05-08 15:00:26 -0400
commit4cfe7bd17640acd296fad4d916aecc27ba8b5f4f (patch)
tree946923d34eb76d45b95b55556809940679577dff /buildscripts
parentd3ee35d6e3ac7a42cd5ad106c3ecb9fb554900c7 (diff)
downloadmongo-4cfe7bd17640acd296fad4d916aecc27ba8b5f4f.tar.gz
SERVER-40823 Enable Flow Control in testing
Diffstat (limited to 'buildscripts')
-rw-r--r--buildscripts/resmokelib/config.py4
-rw-r--r--buildscripts/resmokelib/core/programs.py9
-rw-r--r--buildscripts/resmokelib/parser.py9
3 files changed, 21 insertions, 1 deletions
diff --git a/buildscripts/resmokelib/config.py b/buildscripts/resmokelib/config.py
index 7705682cce1..bc245b2e682 100644
--- a/buildscripts/resmokelib/config.py
+++ b/buildscripts/resmokelib/config.py
@@ -54,6 +54,7 @@ DEFAULTS = {
"dbtest_executable": None,
"dry_run": None,
"exclude_with_any_tags": None,
+ "flow_control": None,
"genny_executable": None,
"include_with_any_tags": None,
"jobs": 1,
@@ -372,6 +373,9 @@ STAGGER_JOBS = None
# If set to true, it enables read concern majority. Else, read concern majority is disabled.
MAJORITY_READ_CONCERN = None
+# If set to true, it enables flow control. Else, flow control is disabled.
+FLOW_CONTROL = 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/core/programs.py b/buildscripts/resmokelib/core/programs.py
index 6ed11e8d28d..881c096d173 100644
--- a/buildscripts/resmokelib/core/programs.py
+++ b/buildscripts/resmokelib/core/programs.py
@@ -119,6 +119,9 @@ def mongod_program( # pylint: disable=too-many-branches
if "replSet" in kwargs and "waitForStepDownOnNonCommandShutdown" not in suite_set_parameters:
suite_set_parameters["waitForStepDownOnNonCommandShutdown"] = False
+ if "enableFlowControl" not in suite_set_parameters:
+ suite_set_parameters["enableFlowControl"] = config.FLOW_CONTROL
+
_apply_set_parameters(args, suite_set_parameters)
shortcut_opts = {
@@ -271,6 +274,10 @@ def mongo_shell_program( # pylint: disable=too-many-branches,too-many-locals,to
mongod_set_parameters.setdefault("logComponentVerbosity",
default_mongod_log_component_verbosity())
+ # If the 'enableFlowControl' setParameter for mongod was not already specified, we set its value
+ # to a default.
+ mongod_set_parameters.setdefault("enableFlowControl", config.FLOW_CONTROL)
+
# If the 'logComponentVerbosity' setParameter for mongos was not already specified, we set its
# value to a default.
mongos_set_parameters.setdefault("logComponentVerbosity",
@@ -382,6 +389,8 @@ def dbtest_program(logger, executable=None, suites=None, process_kwargs=None, **
if config.STORAGE_ENGINE is not None:
kwargs["storageEngine"] = config.STORAGE_ENGINE
+ kwargs["flowControl"] = config.FLOW_CONTROL
+
return generic_program(logger, args, process_kwargs=process_kwargs, **kwargs)
diff --git a/buildscripts/resmokelib/parser.py b/buildscripts/resmokelib/parser.py
index d03c7704a81..3d3bf63cb5b 100644
--- a/buildscripts/resmokelib/parser.py
+++ b/buildscripts/resmokelib/parser.py
@@ -248,6 +248,11 @@ def _make_parser(): # pylint: disable=too-many-statements
"off"), metavar="ON|OFF", help=("Enable or disable majority read concern support."
" Defaults to %default."))
+ parser.add_option("--flowControl", type="choice", action="store", dest="flow_control",
+ choices=("on",
+ "off"), metavar="ON|OFF", help=("Enable or disable flow control."
+ " Defaults to %default."))
+
parser.add_option("--storageEngine", dest="storage_engine", metavar="ENGINE",
help="The storage engine used by dbtests and jstests.")
@@ -377,7 +382,8 @@ def _make_parser(): # pylint: disable=too-many-statements
parser.set_defaults(benchrun_device="Desktop", dry_run="off", find_suites=False,
list_suites=False, logger_file="console", shuffle="auto",
- stagger_jobs="off", suite_files="with_server", majority_read_concern="on")
+ stagger_jobs="off", suite_files="with_server", majority_read_concern="on",
+ flow_control="on")
return parser
@@ -565,6 +571,7 @@ def _update_config_vars(values): # pylint: disable=too-many-statements
_config.EXCLUDE_WITH_ANY_TAGS.extend(
utils.default_if_none(_tags_from_list(config.pop("exclude_with_any_tags")), []))
_config.FAIL_FAST = not config.pop("continue_on_failure")
+ _config.FLOW_CONTROL = config.pop("flow_control") == "on"
_config.INCLUDE_WITH_ANY_TAGS = _tags_from_list(config.pop("include_with_any_tags"))
_config.GENNY_EXECUTABLE = _expand_user(config.pop("genny_executable"))
_config.JOBS = config.pop("jobs")