diff --git a/bazel/resmoke/resmoke_shim.py b/bazel/resmoke/resmoke_shim.py index b1b6db9dbfd..f113d9832ae 100644 --- a/bazel/resmoke/resmoke_shim.py +++ b/bazel/resmoke/resmoke_shim.py @@ -105,6 +105,19 @@ if __name__ == "__main__": "--suites", "--originSuite" ) + # Reduce the storage engine's cache size (if not already set) to reduce the likelihood + # of a mongod process being killed by the OOM killer. The configuration of the + # cache size is duplicated in evergreen/resmoke_tests_execute.sh, please update both. + storage_engine_in_memory = "--storageEngine=inMemory" in resmoke_args + storage_engine_cache_arg = [ + arg for arg in resmoke_args if arg.startswith("--storageEngineCacheSizeGB") + ] + if not storage_engine_cache_arg: + if storage_engine_in_memory: + resmoke_args.append("--storageEngineCacheSizeGB=4") + else: + resmoke_args.append("--storageEngineCacheSizeGB=1") + add_evergreen_build_info(resmoke_args) if os.environ.get("DEPS_PATH"): diff --git a/buildscripts/resmokeconfig/BUILD.bazel b/buildscripts/resmokeconfig/BUILD.bazel index 5dac61f36e7..8908831aaff 100644 --- a/buildscripts/resmokeconfig/BUILD.bazel +++ b/buildscripts/resmokeconfig/BUILD.bazel @@ -55,9 +55,6 @@ resmoke_suite_test( # Queryable encryption is not supported on standalone. "//jstests/core/query/queryable_encryption:all_subpackage_javascript_files", ], - resmoke_args = [ - "--storageEngineCacheSizeGB=1", - ], shard_count = 24, tags = [ "ci-development-critical-single-variant", @@ -81,9 +78,6 @@ resmoke_suite_test( ], config = ":suites/jstestfuzz.yml", data = [":common_jstest_data"], - resmoke_args = [ - "--storageEngineCacheSizeGB=1", - ], tags = [ "manual", # exclude from expansion of target pattern wildcards (..., :*, :all, etc.) ], @@ -110,9 +104,6 @@ resmoke_suite_test( ":matrix_suites/overrides/multiversion.yml", "//:multiversion_binaries", ], - resmoke_args = [ - "--storageEngineCacheSizeGB=1", - ], shard_count = 1, tags = [ "manual", # exclude from expansion of target pattern wildcards (..., :*, :all, etc.) @@ -140,9 +131,6 @@ resmoke_suite_test( ":matrix_suites/overrides/multiversion.yml", "//:multiversion_binaries", ], - resmoke_args = [ - "--storageEngineCacheSizeGB=1", - ], shard_count = 1, tags = [ "manual", # exclude from expansion of target pattern wildcards (..., :*, :all, etc.) diff --git a/evergreen/resmoke_tests_execute.sh b/evergreen/resmoke_tests_execute.sh index db38fac621d..c39ef1de49f 100755 --- a/evergreen/resmoke_tests_execute.sh +++ b/evergreen/resmoke_tests_execute.sh @@ -91,7 +91,8 @@ if [[ ${disable_unit_tests} = "false" && ! -f ${skip_tests} ]]; then # We reduce the storage engine's cache size to reduce the likelihood of a mongod process # being killed by the OOM killer. The --storageEngineCacheSizeGB command line option is only # filled in with a default value here if one hasn't already been specified in the task's - # definition or build variant's definition. + # definition or build variant's definition. The configuration of cache size is duplicated in + # bazel/resmoke/resmoke_shim.py, please update both. set +o errexit echo "${resmoke_args} ${test_flags}" | grep -q storageEngineCacheSizeGB if [ $? -eq 1 ]; then