diff options
author | William Schultz <william.schultz@mongodb.com> | 2018-07-09 19:32:06 -0400 |
---|---|---|
committer | William Schultz <william.schultz@mongodb.com> | 2018-08-13 18:07:39 -0400 |
commit | 5b523ccf4a5df3021dc025a05853879fda05cd0a (patch) | |
tree | 21b6e4f706965a9b75f56e8bf33b59c144652194 /buildscripts | |
parent | 9b975539a9c715a34dc478a8a947f82789a15b53 (diff) | |
download | mongo-5b523ccf4a5df3021dc025a05853879fda05cd0a.tar.gz |
SERVER-32907 Reduce replication.heartbeat log verbosity in local test logs
This patch creates separate 'logComponentVerbosity' default settings
for tests running running locally versus those running in
Evergreen. This only applies to tests run using resmoke.py. We detect
that a test is running in Evergreen by checking if resmoke received
an EVERGREEN_TASK_ID parameter.
(cherry picked from commit 4c725a11acf11e41e8200500a03d3cec97a25dbe)
Diffstat (limited to 'buildscripts')
-rw-r--r-- | buildscripts/resmokelib/core/programs.py | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/buildscripts/resmokelib/core/programs.py b/buildscripts/resmokelib/core/programs.py index f564d3b3556..8c5ebc52154 100644 --- a/buildscripts/resmokelib/core/programs.py +++ b/buildscripts/resmokelib/core/programs.py @@ -14,9 +14,26 @@ from . import process as _process from .. import config from .. import utils -# The default 'logComponentVerbosity' object for mongod processes started either directly via -# resmoke or those that will get started by the mongo shell. -DEFAULT_MONGOD_LOG_COMPONENT_VERBOSITY = {"replication": {"heartbeats": 2, "rollback": 2}} +# The below parameters define the default 'logComponentVerbosity' object passed to mongod processes +# started either directly via resmoke or those that will get started by the mongo shell. We allow +# this default to be different for tests run locally and tests run in Evergreen. This allows us, for +# example, to keep log verbosity high in Evergreen test runs without polluting the logs for +# developers running local tests. + +# The default verbosity setting for any tests that are not started with an Evergreen task id. This +# will apply to any tests run locally. +DEFAULT_MONGOD_LOG_COMPONENT_VERBOSITY = {"replication": {"rollback": 2}} + +# The default verbosity setting for any tests running in Evergreen i.e. started with an Evergreen +# task id. +DEFAULT_EVERGREEN_MONGOD_LOG_COMPONENT_VERBOSITY = {"replication": {"heartbeats": 2, "rollback": 2}} + + +def default_mongod_log_component_verbosity(): + """Return the default 'logComponentVerbosity' value to use for mongod processes.""" + if config.EVERGREEN_TASK_ID: + return DEFAULT_EVERGREEN_MONGOD_LOG_COMPONENT_VERBOSITY + return DEFAULT_MONGOD_LOG_COMPONENT_VERBOSITY def mongod_program( # pylint: disable=too-many-branches @@ -35,7 +52,7 @@ def mongod_program( # pylint: disable=too-many-branches # Set default log verbosity levels if none were specified. if "logComponentVerbosity" not in suite_set_parameters: - suite_set_parameters["logComponentVerbosity"] = DEFAULT_MONGOD_LOG_COMPONENT_VERBOSITY + suite_set_parameters["logComponentVerbosity"] = default_mongod_log_component_verbosity() # orphanCleanupDelaySecs controls an artificial delay before cleaning up an orphaned chunk # that has migrated off of a shard, meant to allow most dependent queries on secondaries to @@ -199,7 +216,7 @@ def mongo_shell_program( # pylint: disable=too-many-branches,too-many-locals,to # If the 'logComponentVerbosity' setParameter for mongod was not already specified, we set its # value to a default. mongod_set_parameters.setdefault("logComponentVerbosity", - DEFAULT_MONGOD_LOG_COMPONENT_VERBOSITY) + default_mongod_log_component_verbosity()) test_data["setParameters"] = mongod_set_parameters |