aboutsummaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
Diffstat (limited to 'unittests')
-rw-r--r--unittests/lit.common.unit.cfg16
-rw-r--r--unittests/lit_unittest_cfg_utils.py4
2 files changed, 20 insertions, 0 deletions
diff --git a/unittests/lit.common.unit.cfg b/unittests/lit.common.unit.cfg
index 2bd8f376f00e..b08c1fe12831 100644
--- a/unittests/lit.common.unit.cfg
+++ b/unittests/lit.common.unit.cfg
@@ -28,3 +28,19 @@ if 'TMP' in os.environ:
config.environment['TMP'] = os.environ['TMP']
if 'TEMP' in os.environ:
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
+
+ # 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.
+ # Therefore, we have to put the code in a .py file, add it to path, and import
+ # it to store it in the config.
+ import site
+ site.addsitedir(os.path.dirname(__file__))
+ import lit_unittest_cfg_utils
+ config.darwin_sanitizer_parallelism_group_func = \
+ lit_unittest_cfg_utils.darwin_sanitizer_parallelism_group_func
diff --git a/unittests/lit_unittest_cfg_utils.py b/unittests/lit_unittest_cfg_utils.py
new file mode 100644
index 000000000000..ff7b1ee0140b
--- /dev/null
+++ b/unittests/lit_unittest_cfg_utils.py
@@ -0,0 +1,4 @@
+# Put all 64-bit sanitizer tests in the darwin-64bit-sanitizer parallelism
+# group. This will only run three of them concurrently.
+def darwin_sanitizer_parallelism_group_func(test):
+ return "darwin-64bit-sanitizer" if "x86_64" in test.file_path else ""