aboutsummaryrefslogtreecommitdiff
path: root/run_project_tests.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-11-22 22:39:26 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2016-12-02 22:40:54 +0200
commited33e64c71e6e1974f988f6ff2df1ed0957ac9ad (patch)
tree12e8dca08a2c2ef928b6e05032e4eead90a76c28 /run_project_tests.py
parente4a755ba92ed5fd7a1767492dce290b2dc9e3c59 (diff)
downloadmeson-ed33e64c71e6e1974f988f6ff2df1ed0957ac9ad.zip
meson-ed33e64c71e6e1974f988f6ff2df1ed0957ac9ad.tar.gz
meson-ed33e64c71e6e1974f988f6ff2df1ed0957ac9ad.tar.bz2
Guard against cpu_count failing.
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-xrun_project_tests.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/run_project_tests.py b/run_project_tests.py
index dcc6006..6f4d0a3 100755
--- a/run_project_tests.py
+++ b/run_project_tests.py
@@ -380,7 +380,14 @@ def run_tests(extra_args):
build_time = 0
test_time = 0
- executor = conc.ProcessPoolExecutor(max_workers=multiprocessing.cpu_count())
+ try:
+ # This fails in some CI environments for unknown reasons.
+ num_workers = multiprocessing.cpu_count()
+ except Exception as e:
+ print('Could not determine number of CPUs due to the following reason:' + str(e))
+ print('Defaulting to using only one process')
+ num_workers = 1
+ executor = conc.ProcessPoolExecutor(max_workers=num_workers)
for name, test_cases, skipped in all_tests:
current_suite = ET.SubElement(junit_root, 'testsuite', {'name' : name, 'tests' : str(len(test_cases))})