diff --git a/compiler-rt/test/asan/lit.cfg b/compiler-rt/test/asan/lit.cfg --- a/compiler-rt/test/asan/lit.cfg +++ b/compiler-rt/test/asan/lit.cfg @@ -220,6 +220,4 @@ if config.host_os not in ['Linux', 'Darwin', 'FreeBSD', 'SunOS', 'Windows', 'NetBSD']: config.unsupported = True -if config.host_os == 'Darwin': - if config.target_arch in ["x86_64", "x86_64h"]: - config.parallelism_group = "darwin-64bit-sanitizer" +config.parallelism_group = 'shadow-memory' diff --git a/compiler-rt/test/fuzzer/lit.cfg b/compiler-rt/test/fuzzer/lit.cfg --- a/compiler-rt/test/fuzzer/lit.cfg +++ b/compiler-rt/test/fuzzer/lit.cfg @@ -126,6 +126,4 @@ config.substitutions.append(('%env_asan_opts=', 'env ASAN_OPTIONS=' + default_asan_opts_str)) -if config.host_os == 'Darwin': - if config.target_arch in ["x86_64", "x86_64h"]: - config.parallelism_group = "darwin-64bit-sanitizer" +config.parallelism_group = 'shadow-memory' diff --git a/compiler-rt/test/lit.common.cfg b/compiler-rt/test/lit.common.cfg --- a/compiler-rt/test/lit.common.cfg +++ b/compiler-rt/test/lit.common.cfg @@ -401,17 +401,23 @@ if platform.system() == 'Windows': config.test_retry_attempts = 2 -# Only run up to 3 64-bit sanitized processes simultaneously on Darwin. -# Using more scales badly and hogs the system due to inefficient handling -# of large mmap'd regions (terabytes) by the kernel. -if platform.system() == 'Darwin': - lit_config.parallelism_groups["darwin-64bit-sanitizer"] = 3 +# No throttling on non-Darwin platforms. +lit_config.parallelism_groups['shadow-memory'] = None -# Force sequential execution when running tests on iOS devices. -if config.host_os == 'Darwin' and config.apple_platform != "osx" and not config.apple_platform.endswith("sim"): - lit_config.warning("iOS device test cases being run sequentially") - lit_config.parallelism_groups["ios-device"] = 1 - config.parallelism_group = "ios-device" +if platform.system() == 'Darwin': + ios_device = config.apple_platform != 'osx' and not config.apple_platform.endswith('sim') + # Force sequential execution when running tests on iOS devices. + if ios_device: + lit_config.warning('Forcing sequential execution for iOS device tests') + lit_config.parallelism_groups['ios-device'] = 1 + config.parallelism_group = 'ios-device' + + # Only run up to 3 processes that require shadow memory simultaneously on + # 64-bit Darwin. Using more scales badly and hogs the system due to + # inefficient handling of large mmap'd regions (terabytes) by the kernel. + elif config.target_arch in ['x86_64', 'x86_64h']: + lit_config.warning('Throttling sanitizer tests that require shadow memory on Darwin 64bit') + lit_config.parallelism_groups['shadow-memory'] = 3 # Multiple substitutions are necessary to support multiple shared objects used # at once. diff --git a/compiler-rt/test/sanitizer_common/Unit/lit.site.cfg.in b/compiler-rt/test/sanitizer_common/Unit/lit.site.cfg.in --- a/compiler-rt/test/sanitizer_common/Unit/lit.site.cfg.in +++ b/compiler-rt/test/sanitizer_common/Unit/lit.site.cfg.in @@ -12,3 +12,6 @@ config.test_exec_root = os.path.join("@COMPILER_RT_BINARY_DIR@", "lib", "sanitizer_common", "tests") config.test_source_root = config.test_exec_root + +if config.host_os == 'Darwin': + config.parallelism_group = config.darwin_sanitizer_parallelism_group_func diff --git a/compiler-rt/test/sanitizer_common/lit.common.cfg b/compiler-rt/test/sanitizer_common/lit.common.cfg --- a/compiler-rt/test/sanitizer_common/lit.common.cfg +++ b/compiler-rt/test/sanitizer_common/lit.common.cfg @@ -71,6 +71,4 @@ if config.host_os not in ['Linux', 'Darwin', 'NetBSD', 'FreeBSD']: config.unsupported = True -if config.host_os == 'Darwin': - if config.target_arch in ["x86_64", "x86_64h"]: - config.parallelism_group = "darwin-64bit-sanitizer" +config.parallelism_group = 'shadow-memory' diff --git a/compiler-rt/test/tsan/lit.cfg b/compiler-rt/test/tsan/lit.cfg --- a/compiler-rt/test/tsan/lit.cfg +++ b/compiler-rt/test/tsan/lit.cfg @@ -85,6 +85,4 @@ if config.android: config.unsupported = True -if config.host_os == 'Darwin': - if config.target_arch in ["x86_64", "x86_64h"]: - config.parallelism_group = "darwin-64bit-sanitizer" +config.parallelism_group = 'shadow-memory' diff --git a/compiler-rt/unittests/lit.common.unit.cfg b/compiler-rt/unittests/lit.common.unit.cfg --- a/compiler-rt/unittests/lit.common.unit.cfg +++ b/compiler-rt/unittests/lit.common.unit.cfg @@ -30,10 +30,10 @@ config.environment['TEMP'] = os.environ['TEMP'] if config.host_os == 'Darwin': - # Only run up to 3 64-bit sanitized processes simultaneously on Darwin. - # Using more scales badly and hogs the system due to inefficient handling - # of large mmap'd regions (terabytes) by the kernel. - lit_config.parallelism_groups["darwin-64bit-sanitizer"] = 3 + # Only run up to 3 processes that require shadow memory simultaneously on + # 64-bit Darwin. Using more scales badly and hogs the system due to + # inefficient handling of large mmap'd regions (terabytes) by the kernel. + lit_config.parallelism_groups["shadow-memory"] = 3 # The test config gets pickled and sent to multiprocessing workers, and that # only works for code if it is stored at the top level of some module. diff --git a/compiler-rt/unittests/lit_unittest_cfg_utils.py b/compiler-rt/unittests/lit_unittest_cfg_utils.py --- a/compiler-rt/unittests/lit_unittest_cfg_utils.py +++ b/compiler-rt/unittests/lit_unittest_cfg_utils.py @@ -1,4 +1,4 @@ -# Put all 64-bit sanitizer tests in the darwin-64bit-sanitizer parallelism -# group. This will only run three of them concurrently. +# Put all 64-bit tests in the shadow-memory parallelism group. We throttle those +# in our common lit config (lit.common.unit.cfg). def darwin_sanitizer_parallelism_group_func(test): - return "darwin-64bit-sanitizer" if "x86_64" in test.file_path else "" + return "shadow-memory" if "x86_64" in test.file_path else None