diff options
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-x | run_project_tests.py | 9 |
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))}) |