diff options
author | Louis Williams <louis.williams@mongodb.com> | 2022-12-16 16:14:40 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-01-26 11:00:25 +0000 |
commit | 1c9cb26ee2ecaf28f0736611bd1f9f633c7cfacc (patch) | |
tree | 79cd176547fccd6c8cf2432f5ee7852c9b400570 /buildscripts | |
parent | cc0dc721042c7ffa2d00a0f414d65c650f646918 (diff) | |
download | mongo-1c9cb26ee2ecaf28f0736611bd1f9f633c7cfacc.tar.gz |
SERVER-70695 Add config fuzzer sharding tests
This commit also reorganizes the config fuzzer so that stressful tests
run less frequently and with a higher task timeout and run in more
places, like UBSAN.
Diffstat (limited to 'buildscripts')
-rw-r--r-- | buildscripts/resmokelib/config.py | 4 | ||||
-rw-r--r-- | buildscripts/resmokelib/configure_resmoke.py | 8 | ||||
-rw-r--r-- | buildscripts/resmokelib/mongod_fuzzer_configs.py | 14 | ||||
-rw-r--r-- | buildscripts/resmokelib/run/__init__.py | 10 |
4 files changed, 20 insertions, 16 deletions
diff --git a/buildscripts/resmokelib/config.py b/buildscripts/resmokelib/config.py index 98b8d290ad1..f285c6b21de 100644 --- a/buildscripts/resmokelib/config.py +++ b/buildscripts/resmokelib/config.py @@ -65,7 +65,7 @@ DEFAULTS = { "exclude_with_any_tags": None, "flow_control": None, "flow_control_tickets": None, - "fuzz_mongod_configs": False, + "fuzz_mongod_configs": None, "config_fuzz_seed": None, "genny_executable": None, "include_with_any_tags": None, @@ -355,7 +355,7 @@ EXCLUDED_TAG = "__TEMPORARILY_DISABLED__" # If true, then a test failure or error will cause resmoke.py to exit and not run any more tests. FAIL_FAST = None -FUZZ_MONGOD_CONFIGS = False +FUZZ_MONGOD_CONFIGS = None CONFIG_FUZZ_SEED = None # Executable file for genny, passed in as a command line arg. diff --git a/buildscripts/resmokelib/configure_resmoke.py b/buildscripts/resmokelib/configure_resmoke.py index 3cf42fb3b0c..cfb856491d0 100644 --- a/buildscripts/resmokelib/configure_resmoke.py +++ b/buildscripts/resmokelib/configure_resmoke.py @@ -307,7 +307,7 @@ or explicitly pass --installDir to the run subcommand of buildscripts/resmoke.py _config.CONFIG_FUZZ_SEED = int(_config.CONFIG_FUZZ_SEED) _config.MONGOD_SET_PARAMETERS, _config.WT_ENGINE_CONFIG, _config.WT_COLL_CONFIG, \ _config.WT_INDEX_CONFIG = mongod_fuzzer_configs.fuzz_set_parameters( - _config.CONFIG_FUZZ_SEED, _config.MONGOD_SET_PARAMETERS) + _config.FUZZ_MONGOD_CONFIGS, _config.CONFIG_FUZZ_SEED, _config.MONGOD_SET_PARAMETERS) _config.EXCLUDE_WITH_ANY_TAGS.extend(["uses_compact"]) _config.MONGOS_EXECUTABLE = _expand_user(config.pop("mongos_executable")) @@ -377,13 +377,13 @@ or explicitly pass --installDir to the run subcommand of buildscripts/resmoke.py # Wiredtiger options. Prevent fuzzed wt configs from being overwritten unless user specifies it. wt_engine_config = config.pop("wt_engine_config") if wt_engine_config: - _config.WT_ENGINE_CONFIG = config.pop("wt_engine_config") + _config.WT_ENGINE_CONFIG = wt_engine_config wt_coll_config = config.pop("wt_coll_config") if wt_coll_config: - _config.WT_COLL_CONFIG = config.pop("wt_coll_config") + _config.WT_COLL_CONFIG = wt_coll_config wt_index_config = config.pop("wt_index_config") if wt_index_config: - _config.WT_INDEX_CONFIG = config.pop("wt_index_config") + _config.WT_INDEX_CONFIG = wt_index_config # Benchmark/Benchrun options. _config.BENCHMARK_FILTER = config.pop("benchmark_filter") diff --git a/buildscripts/resmokelib/mongod_fuzzer_configs.py b/buildscripts/resmokelib/mongod_fuzzer_configs.py index 69a2a19fd15..c449da32e22 100644 --- a/buildscripts/resmokelib/mongod_fuzzer_configs.py +++ b/buildscripts/resmokelib/mongod_fuzzer_configs.py @@ -4,7 +4,7 @@ import random from buildscripts.resmokelib import utils -def generate_eviction_configs(rng): +def generate_eviction_configs(rng, mode): """Generate random configurations for wiredTigerEngineConfigString parameter.""" eviction_checkpoint_target = rng.randint(1, 99) eviction_target = rng.randint(50, 95) @@ -47,7 +47,7 @@ def generate_eviction_configs(rng): # The setting is trigerring bugs, disabled until they get resolved. # dbg_rollback_error = rng.choice([0, rng.randint(250, 1500)]) dbg_rollback_error = 0 - dbg_slow_checkpoint = rng.choice(['true', 'false']) + dbg_slow_checkpoint = 'false' if mode != 'stress' else rng.choice(['true', 'false']) return "debug_mode=(eviction={0},realloc_exact={1},rollback_error={2}, slow_checkpoint={3}),"\ "eviction_checkpoint_target={4},eviction_dirty_target={5},eviction_dirty_trigger={6},"\ @@ -112,14 +112,14 @@ def generate_flow_control_parameters(rng): return configs -def generate_independent_parameters(rng): +def generate_independent_parameters(rng, mode): """Return a dictionary with values for each independent parameter.""" ret = {} ret["wiredTigerCursorCacheSize"] = rng.randint(-100, 100) ret["wiredTigerSessionCloseIdleTimeSecs"] = rng.randint(0, 300) ret["wiredTigerConcurrentWriteTransactions"] = rng.randint(5, 32) ret["wiredTigerConcurrentReadTransactions"] = rng.randint(5, 32) - ret["wiredTigerStressConfig"] = rng.choice([True, False]) + ret["wiredTigerStressConfig"] = False if mode != 'stress' else rng.choice([True, False]) if rng.choice(3 * [True] + [False]): # The old retryable writes format is used by other variants. Weight towards turning on the # new retryable writes format on in this one. @@ -130,12 +130,12 @@ def generate_independent_parameters(rng): return ret -def fuzz_set_parameters(seed, user_provided_params): +def fuzz_set_parameters(mode, seed, user_provided_params): """Randomly generate mongod configurations and wiredTigerConnectionString.""" rng = random.Random(seed) ret = {} - params = [generate_flow_control_parameters(rng), generate_independent_parameters(rng)] + params = [generate_flow_control_parameters(rng), generate_independent_parameters(rng, mode)] for dct in params: for key, value in dct.items(): ret[key] = value @@ -143,5 +143,5 @@ def fuzz_set_parameters(seed, user_provided_params): for key, value in utils.load_yaml(user_provided_params).items(): ret[key] = value - return utils.dump_yaml(ret), generate_eviction_configs(rng), generate_table_configs(rng), \ + return utils.dump_yaml(ret), generate_eviction_configs(rng, mode), generate_table_configs(rng), \ generate_table_configs(rng) diff --git a/buildscripts/resmokelib/run/__init__.py b/buildscripts/resmokelib/run/__init__.py index 74a29919490..6fe5537eec9 100644 --- a/buildscripts/resmokelib/run/__init__.py +++ b/buildscripts/resmokelib/run/__init__.py @@ -265,7 +265,8 @@ class TestRunner(Subcommand): local_args = strip_fuzz_config_params(local_args) local_resmoke_invocation = ( f"{os.path.join('buildscripts', 'resmoke.py')} {' '.join(local_args)}" - f" --fuzzMongodConfigs --configFuzzSeed={str(config.CONFIG_FUZZ_SEED)}") + f" --fuzzMongodConfigs={config.FUZZ_MONGOD_CONFIGS} --configFuzzSeed={str(config.CONFIG_FUZZ_SEED)}" + ) self._resmoke_logger.info("Fuzzed mongodSetParameters:\n%s", config.MONGOD_SET_PARAMETERS) @@ -946,8 +947,11 @@ class RunPlugin(PluginInterface): help="The transport layer used by jstests") mongodb_server_options.add_argument( - "--fuzzMongodConfigs", dest="fuzz_mongod_configs", action="store_true", - help="Will randomly choose storage configs that were not specified.") + "--fuzzMongodConfigs", dest="fuzz_mongod_configs", + help="Randomly chooses server parameters that were not specified. Use 'stress' to fuzz " + "all configs including stressful storage configurations that may significantly " + "slow down the server. Use 'normal' to only fuzz non-stressful configurations. ", + metavar="MODE", choices=('normal', 'stress')) mongodb_server_options.add_argument("--configFuzzSeed", dest="config_fuzz_seed", metavar="PATH", |