summaryrefslogtreecommitdiff
path: root/buildscripts/resmokelib
diff options
context:
space:
mode:
authorRobert Guo <robert.guo@mongodb.com>2021-07-22 07:35:13 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-07-22 14:50:12 +0000
commitbc5f93907101a0bc7dce0749bfd40d9bb83d73f0 (patch)
treea929f8b6a1258c5e50c62ae8ee282611a1fcee2f /buildscripts/resmokelib
parent73b4bcdabaddc1e2b5b59a19e0d7bae969a85669 (diff)
downloadmongo-bc5f93907101a0bc7dce0749bfd40d9bb83d73f0.tar.gz
SERVER-58172 run multiversion tests on master with 5.0 and disable incompatible tests
Diffstat (limited to 'buildscripts/resmokelib')
-rw-r--r--buildscripts/resmokelib/config.py12
-rw-r--r--buildscripts/resmokelib/configure_resmoke.py2
-rw-r--r--buildscripts/resmokelib/core/programs.py4
-rw-r--r--buildscripts/resmokelib/run/__init__.py2
-rw-r--r--buildscripts/resmokelib/testing/fixtures/_builder.py52
-rw-r--r--buildscripts/resmokelib/testing/fixtures/fixturelib.py5
-rw-r--r--buildscripts/resmokelib/testing/fixtures/replicaset.py25
-rw-r--r--buildscripts/resmokelib/testing/fixtures/shardedcluster.py2
-rw-r--r--buildscripts/resmokelib/testing/fixtures/standalone.py48
9 files changed, 42 insertions, 110 deletions
diff --git a/buildscripts/resmokelib/config.py b/buildscripts/resmokelib/config.py
index 4dcaca7061a..f3e07a449fc 100644
--- a/buildscripts/resmokelib/config.py
+++ b/buildscripts/resmokelib/config.py
@@ -102,7 +102,7 @@ DEFAULTS = {
"transport_layer": None,
"user_friendly_output": None,
"mixed_bin_versions": None,
- "multiversion_bin_version": "last_lts",
+ "old_bin_version": "last_continuous",
"linear_chain": None,
"num_replset_nodes": None,
"num_shards": None,
@@ -244,13 +244,13 @@ class MultiversionOptions(object):
"""Represent the multiversion version choices."""
LAST_LTS = "last_lts"
- LAST_CONTINOUS = "last_continuous"
+ LAST_CONTINUOUS = "last_continuous"
@classmethod
def all_options(cls):
"""Return available version options for multiversion."""
- return [cls.LAST_LTS, cls.LAST_CONTINOUS]
+ return [cls.LAST_LTS, cls.LAST_CONTINUOUS]
##
@@ -565,3 +565,9 @@ LOGGER_DIR = None
# Generated logging config for the current invocation.
LOGGING_CONFIG: dict = {}
SHORTEN_LOGGER_NAME_CONFIG: dict = {}
+
+# Whether legacy multiversion code is used. This value is not used on the master version of
+# resmoke.py but is needed to ensure the v5.0 version of fixture classes (e.g. standalone.py)
+# that get loaded for multiversion tests can behave correctly on master and on v5.0; the latter
+# case runs 5.0 and 4.4 binaries and has this value set to True. Can be removed after 6.0.
+USE_LEGACY_MULTIVERSION = True
diff --git a/buildscripts/resmokelib/configure_resmoke.py b/buildscripts/resmokelib/configure_resmoke.py
index a338157676b..e820e2262d7 100644
--- a/buildscripts/resmokelib/configure_resmoke.py
+++ b/buildscripts/resmokelib/configure_resmoke.py
@@ -210,7 +210,7 @@ def _update_config_vars(values): # pylint: disable=too-many-statements,too-many
if _config.MIXED_BIN_VERSIONS is not None:
_config.MIXED_BIN_VERSIONS = _config.MIXED_BIN_VERSIONS.split("-")
- _config.MULTIVERSION_BIN_VERSION = config.pop("multiversion_bin_version")
+ _config.MULTIVERSION_BIN_VERSION = config.pop("old_bin_version")
_config.INSTALL_DIR = config.pop("install_dir")
if _config.INSTALL_DIR is not None:
diff --git a/buildscripts/resmokelib/core/programs.py b/buildscripts/resmokelib/core/programs.py
index 7b76f82af3b..2a9b3715957 100644
--- a/buildscripts/resmokelib/core/programs.py
+++ b/buildscripts/resmokelib/core/programs.py
@@ -191,8 +191,8 @@ def mongo_shell_program( # pylint: disable=too-many-arguments,too-many-branches
# If the 'logComponentVerbosity' setParameter for mongod was not already specified, we set its
# value to a default.
- mongod_set_parameters.setdefault("logComponentVerbosity",
- mongod_launcher.default_mongod_log_component_verbosity())
+ mongod_set_parameters.setdefault(
+ "logComponentVerbosity", mongod_launcher.get_default_log_component_verbosity_for_mongod())
# If the 'enableFlowControl' setParameter for mongod was not already specified, we set its value
# to a default.
diff --git a/buildscripts/resmokelib/run/__init__.py b/buildscripts/resmokelib/run/__init__.py
index ede083f8454..593f0a8dc84 100644
--- a/buildscripts/resmokelib/run/__init__.py
+++ b/buildscripts/resmokelib/run/__init__.py
@@ -795,7 +795,7 @@ class RunPlugin(PluginInterface):
" with two shards and two replica set nodes each, specify 'old-new-old-new'.")
parser.add_argument(
- "--multiversionBinVersion", type=str, dest="multiversion_bin_version",
+ "--oldBinVersion", type=str, dest="old_bin_version",
choices=config.MultiversionOptions.all_options(),
help="Chose the multiverion binary version as last-lts or last-continuous.")
diff --git a/buildscripts/resmokelib/testing/fixtures/_builder.py b/buildscripts/resmokelib/testing/fixtures/_builder.py
index 5e969e1cc1c..8c74ddfd841 100644
--- a/buildscripts/resmokelib/testing/fixtures/_builder.py
+++ b/buildscripts/resmokelib/testing/fixtures/_builder.py
@@ -18,8 +18,6 @@ FIXTURE_DIR = "buildscripts/resmokelib/testing/fixtures"
RETRIEVE_DIR = "build/multiversionfixtures"
RETRIEVE_LOCK = threading.Lock()
-USE_LEGACY_MULTIVERSION = True
-
_BUILDERS = {} # type: ignore
@@ -63,12 +61,7 @@ class ReplSetBuilder(FixtureBuilder):
"""Build a replica set."""
# We hijack the mixed_bin_versions passed to the fixture.
mixed_bin_versions = kwargs.pop("mixed_bin_versions", config.MIXED_BIN_VERSIONS)
- multiversion_bin_version = kwargs.pop("multiversion_bin_version",
- config.MULTIVERSION_BIN_VERSION)
- if USE_LEGACY_MULTIVERSION:
- # We mark the use of the legacy multiversion system by allowing
- # access to mixed_bin_versions.
- kwargs["mixed_bin_versions"] = mixed_bin_versions
+ old_bin_version = kwargs.pop("old_bin_version", config.MULTIVERSION_BIN_VERSION)
# We also hijack the num_nodes because we need it here.
num_nodes = kwargs.pop("num_nodes", 2)
@@ -88,20 +81,20 @@ class ReplSetBuilder(FixtureBuilder):
classes = []
fcv = None
- multiversion_class_suffix = "_" + multiversion_bin_version
+ multiversion_class_suffix = "_" + old_bin_version
shell_version = {
config.MultiversionOptions.LAST_LTS:
multiversionconstants.LAST_LTS_MONGO_BINARY,
- config.MultiversionOptions.LAST_CONTINOUS:
+ config.MultiversionOptions.LAST_CONTINUOUS:
multiversionconstants.LAST_CONTINUOUS_MONGO_BINARY
- }[multiversion_bin_version]
+ }[old_bin_version]
mongod_version = {
config.MultiversionOptions.LAST_LTS:
multiversionconstants.LAST_LTS_MONGOD_BINARY,
- config.MultiversionOptions.LAST_CONTINOUS:
+ config.MultiversionOptions.LAST_CONTINUOUS:
multiversionconstants.LAST_CONTINUOUS_MONGOD_BINARY
- }[multiversion_bin_version]
+ }[old_bin_version]
if mixed_bin_versions is None:
executables = [latest_mongod for x in range(num_nodes)]
@@ -110,26 +103,16 @@ class ReplSetBuilder(FixtureBuilder):
is_config_svr = "configsvr" in replset_config_options and replset_config_options[
"configsvr"]
- if USE_LEGACY_MULTIVERSION:
+ load_version(version_path_suffix=multiversion_class_suffix, shell_path=shell_version)
+
+ if not is_config_svr:
executables = [
- latest_mongod if (x == "new") else multiversionconstants.LAST_LTS_MONGOD_BINARY
+ latest_mongod if (x == "new") else mongod_version for x in mixed_bin_versions
+ ]
+ classes = [
+ latest_class if (x == "new") else f"{latest_class}{multiversion_class_suffix}"
for x in mixed_bin_versions
]
- classes = [latest_class for x in range(num_nodes)]
- else:
- load_version(version_path_suffix=multiversion_class_suffix,
- shell_path=shell_version)
-
- if not is_config_svr:
- executables = [
- latest_mongod if (x == "new") else mongod_version
- for x in mixed_bin_versions
- ]
- classes = [
- latest_class if
- (x == "new") else f"{latest_class}{multiversion_class_suffix}"
- for x in mixed_bin_versions
- ]
if is_config_svr:
# Our documented recommended path for upgrading shards lets us assume that config
# server nodes will always be fully upgraded before shard nodes.
@@ -138,9 +121,10 @@ class ReplSetBuilder(FixtureBuilder):
num_versions = len(mixed_bin_versions)
fcv = {
- config.MultiversionOptions.LAST_LTS: multiversionconstants.LAST_LTS_FCV,
- config.MultiversionOptions.LAST_CONTINOUS: multiversionconstants.LAST_CONTINUOUS_FCV
- }[multiversion_bin_version]
+ config.MultiversionOptions.LAST_LTS:
+ multiversionconstants.LAST_LTS_FCV, config.MultiversionOptions.LAST_CONTINUOUS:
+ multiversionconstants.LAST_CONTINUOUS_FCV
+ }[old_bin_version]
if num_versions != num_nodes and not is_config_svr:
msg = (("The number of binary versions specified: {} do not match the number of"\
@@ -175,7 +159,7 @@ class ReplSetBuilder(FixtureBuilder):
def load_version(version_path_suffix=None, shell_path=None):
- """Load the last_lts/last_continous fixtures."""
+ """Load the last_lts/last_continuous fixtures."""
with RETRIEVE_LOCK, registry.suffix(version_path_suffix):
# Only one thread needs to retrieve the fixtures.
retrieve_dir = os.path.relpath(os.path.join(RETRIEVE_DIR, version_path_suffix))
diff --git a/buildscripts/resmokelib/testing/fixtures/fixturelib.py b/buildscripts/resmokelib/testing/fixtures/fixturelib.py
index e163340f3a6..f38b71e944f 100644
--- a/buildscripts/resmokelib/testing/fixtures/fixturelib.py
+++ b/buildscripts/resmokelib/testing/fixtures/fixturelib.py
@@ -8,7 +8,7 @@ from buildscripts.resmokelib import logging
from buildscripts.resmokelib.core import network
from buildscripts.resmokelib.utils.history import make_historic as _make_historic
from buildscripts.resmokelib.testing.fixtures import _builder
-from buildscripts.resmokelib.multiversionconstants import LAST_LTS_MONGOD_BINARY, LAST_LTS_MONGOS_BINARY
+from buildscripts.resmokelib.multiversionconstants import LAST_LTS_MONGOD_BINARY, LAST_LTS_MONGOS_BINARY, LAST_CONTINUOUS_MONGOD_BINARY, LAST_CONTINUOUS_MONGOS_BINARY
class FixtureLib(object):
@@ -109,6 +109,9 @@ class _FixtureConfig(object): # pylint: disable=too-many-instance-attributes
self.ALWAYS_USE_LOG_FILES = config.ALWAYS_USE_LOG_FILES
self.LAST_LTS_MONGOD_BINARY = LAST_LTS_MONGOD_BINARY
self.LAST_LTS_MONGOS_BINARY = LAST_LTS_MONGOS_BINARY
+ self.LAST_CONTINUOUS_MONGOD_BINARY = LAST_CONTINUOUS_MONGOD_BINARY
+ self.LAST_CONTINUOUS_MONGOS_BINARY = LAST_CONTINUOUS_MONGOS_BINARY
+ self.USE_LEGACY_MULTIVERSION = config.USE_LEGACY_MULTIVERSION
self.EVERGREEN_TASK_ID = config.EVERGREEN_TASK_ID
self.FLOW_CONTROL = config.FLOW_CONTROL
self.FLOW_CONTROL_TICKETS = config.FLOW_CONTROL_TICKETS
diff --git a/buildscripts/resmokelib/testing/fixtures/replicaset.py b/buildscripts/resmokelib/testing/fixtures/replicaset.py
index 5dd35620212..1251c0607a0 100644
--- a/buildscripts/resmokelib/testing/fixtures/replicaset.py
+++ b/buildscripts/resmokelib/testing/fixtures/replicaset.py
@@ -61,31 +61,6 @@ class ReplicaSetFixture(interface.ReplFixture): # pylint: disable=too-many-inst
linear_chain)
self.linear_chain = linear_chain_option if linear_chain_option else linear_chain
- # Legacy multiversion line
- if self.mixed_bin_versions is not None:
- mongod_executable = self.fixturelib.default_if_none(
- self.mongod_executable, self.config.MONGOD_EXECUTABLE,
- self.config.DEFAULT_MONGOD_EXECUTABLE)
- latest_mongod = mongod_executable
- # The last-lts binary is currently expected to live in '/data/multiversion', which is
- # part of the PATH.
- is_config_svr = "configsvr" in self.replset_config_options and self.replset_config_options[
- "configsvr"]
- if not is_config_svr:
- self.mixed_bin_versions = [
- latest_mongod if (x == "new") else self.config.LAST_LTS_MONGOD_BINARY
- for x in self.mixed_bin_versions
- ]
- else:
- # Our documented recommended path for upgrading shards lets us assume that config
- # server nodes will always be fully upgraded before shard nodes.
- self.mixed_bin_versions = [latest_mongod, latest_mongod]
- num_versions = len(self.mixed_bin_versions)
- if num_versions != self.num_nodes and not is_config_svr:
- msg = (("The number of binary versions specified: {} do not match the number of"\
- " nodes in the replica set: {}.")).format(num_versions, self.num_nodes)
- raise self.fixturelib.ServerFailure(msg)
-
# By default, we only use a replica set connection string if all nodes are capable of being
# elected primary.
if self.use_replica_set_connection_string is None:
diff --git a/buildscripts/resmokelib/testing/fixtures/shardedcluster.py b/buildscripts/resmokelib/testing/fixtures/shardedcluster.py
index 738f271176e..b0b2d1b7b8a 100644
--- a/buildscripts/resmokelib/testing/fixtures/shardedcluster.py
+++ b/buildscripts/resmokelib/testing/fixtures/shardedcluster.py
@@ -366,7 +366,7 @@ class ShardedClusterFixture(interface.Fixture): # pylint: disable=too-many-inst
# The last-lts binary is currently expected to live in '/data/multiversion', which is
# part of the PATH.
- mongos_executable = self.mongos_executable if self.mixed_bin_versions is None else self.config.LAST_LTS_MONGOS_BINARY
+ mongos_executable = self.mongos_executable if self.mixed_bin_versions is None else self.config.LAST_CONTINUOUS_MONGOS_BINARY
return _MongoSFixture(mongos_logger, self.job_num, self.fixturelib,
dbpath_prefix=self._dbpath_prefix,
diff --git a/buildscripts/resmokelib/testing/fixtures/standalone.py b/buildscripts/resmokelib/testing/fixtures/standalone.py
index b0c23310474..2f1923a150a 100644
--- a/buildscripts/resmokelib/testing/fixtures/standalone.py
+++ b/buildscripts/resmokelib/testing/fixtures/standalone.py
@@ -187,8 +187,6 @@ DEFAULT_MONGOD_LOG_COMPONENT_VERBOSITY = {
"tenantMigration": 4
}
-DEFAULT_LAST_LTS_MONGOD_LOG_COMPONENT_VERBOSITY = {"replication": {"rollback": 2}, "transaction": 4}
-
# The default verbosity setting for any mongod processes running in Evergreen i.e. started with an
# Evergreen task id.
DEFAULT_EVERGREEN_MONGOD_LOG_COMPONENT_VERBOSITY = {
@@ -196,13 +194,6 @@ DEFAULT_EVERGREEN_MONGOD_LOG_COMPONENT_VERBOSITY = {
"sharding": {"migration": 2}, "storage": {"recovery": 2}, "transaction": 4, "tenantMigration": 4
}
-# The default verbosity setting for any last-lts mongod processes running in Evergreen i.e. started
-# with an Evergreen task id.
-DEFAULT_EVERGREEN_LAST_LTS_MONGOD_LOG_COMPONENT_VERBOSITY = {
- "replication": {"election": 4, "heartbeats": 2, "initialSync": 2, "rollback": 2},
- "storage": {"recovery": 2}, "transaction": 4
-}
-
class MongodLauncher(object):
"""Class with utilities for launching a mongod."""
@@ -237,8 +228,7 @@ class MongodLauncher(object):
# Set default log verbosity levels if none were specified.
if "logComponentVerbosity" not in suite_set_parameters:
suite_set_parameters[
- "logComponentVerbosity"] = self.get_default_log_component_verbosity_for_mongod(
- executable)
+ "logComponentVerbosity"] = self.get_default_log_component_verbosity_for_mongod()
# minNumChunksForSessionsCollection controls the minimum number of chunks the balancer will
# enforce for the sessions collection. If the actual number of chunks is less, the balancer will
@@ -263,24 +253,11 @@ class MongodLauncher(object):
# Set coordinateCommitReturnImmediatelyAfterPersistingDecision to false so that tests do
# not need to rely on causal consistency or explicitly wait for the transaction to finish
- # committing. If we are running LAST_LTS mongoD and the test suite has explicitly set the
- # coordinateCommitReturnImmediatelyAfterPersistingDecision parameter, we remove it from
- # the setParameter list, since coordinateCommitReturnImmediatelyAfterPersistingDecision
- # does not exist prior to 4.7.
- # TODO(SERVER-51682): remove the 'elif' clause on master when 5.0 becomes LAST_LTS.
- if executable != self.config.LAST_LTS_MONGOD_BINARY and \
- "coordinateCommitReturnImmediatelyAfterPersistingDecision" not in suite_set_parameters:
+ # committing.
+ if "coordinateCommitReturnImmediatelyAfterPersistingDecision" not in suite_set_parameters:
suite_set_parameters["coordinateCommitReturnImmediatelyAfterPersistingDecision"] = False
- elif executable == self.config.LAST_LTS_MONGOD_BINARY and \
- "coordinateCommitReturnImmediatelyAfterPersistingDecision" in suite_set_parameters:
- del suite_set_parameters["coordinateCommitReturnImmediatelyAfterPersistingDecision"]
- # TODO SERVER-54593 to remove the special-case handling when 5.0 becomes LAST_LTS.
- if "reshardingMinimumOperationDurationMillis" in suite_set_parameters:
- if executable == self.config.LAST_LTS_MONGOD_BINARY:
- del suite_set_parameters["reshardingMinimumOperationDurationMillis"]
- elif executable != self.config.LAST_LTS_MONGOD_BINARY:
- suite_set_parameters["reshardingMinimumOperationDurationMillis"] = 5000
+ suite_set_parameters["reshardingMinimumOperationDurationMillis"] = 5000
# There's a periodic background thread that checks for and aborts expired transactions.
# "transactionLifetimeLimitSeconds" specifies for how long a transaction can run before expiring
@@ -308,8 +285,7 @@ class MongodLauncher(object):
# this to 100ms for faster shutdown. On branches 4.4 and earlier, there is no quiesce mode, but
# the default time for stepdown is 10 seconds.
if ("replSet" in mongod_options
- and "shutdownTimeoutMillisForSignaledShutdown" not in suite_set_parameters
- and executable != self.config.LAST_LTS_MONGOD_BINARY):
+ and "shutdownTimeoutMillisForSignaledShutdown" not in suite_set_parameters):
suite_set_parameters["shutdownTimeoutMillisForSignaledShutdown"] = 100
if "enableFlowControl" not in suite_set_parameters and self.config.FLOW_CONTROL is not None:
@@ -374,24 +350,12 @@ class MongodLauncher(object):
return self.fixturelib.mongod_program(logger, job_num, executable, process_kwargs,
mongod_options)
- def get_default_log_component_verbosity_for_mongod(self, executable):
- """Return the correct default 'logComponentVerbosity' value for the executable version."""
- if executable == self.config.LAST_LTS_MONGOD_BINARY:
- return self.default_last_lts_mongod_log_component_verbosity()
- return self.default_mongod_log_component_verbosity()
-
- def default_mongod_log_component_verbosity(self):
+ def get_default_log_component_verbosity_for_mongod(self):
"""Return the default 'logComponentVerbosity' value to use for mongod processes."""
if self.config.EVERGREEN_TASK_ID:
return DEFAULT_EVERGREEN_MONGOD_LOG_COMPONENT_VERBOSITY
return DEFAULT_MONGOD_LOG_COMPONENT_VERBOSITY
- def default_last_lts_mongod_log_component_verbosity(self):
- """Return the default 'logComponentVerbosity' value to use for last-lts mongod processes."""
- if self.config.EVERGREEN_TASK_ID:
- return DEFAULT_EVERGREEN_LAST_LTS_MONGOD_LOG_COMPONENT_VERBOSITY
- return DEFAULT_LAST_LTS_MONGOD_LOG_COMPONENT_VERBOSITY
-
def _add_testing_set_parameters(suite_set_parameters):
"""