diff --git a/projects/pt1/python/torch_mlir_e2e_test/framework.py b/projects/pt1/python/torch_mlir_e2e_test/framework.py index 38b027e5d31f..89d80234906b 100644 --- a/projects/pt1/python/torch_mlir_e2e_test/framework.py +++ b/projects/pt1/python/torch_mlir_e2e_test/framework.py @@ -395,8 +395,15 @@ def run_tests( pool = mp.Pool(num_processes) arg_list = zip(tests, repeat(config)) + pool_copy = pool._pool[:] handles = pool.starmap_async(compile_and_run_test, arg_list) - results = handles.get(timeout=360) + while not handles.ready(): + if any(proc.exitcode for proc in pool_copy): + print("At least one of testing processes has exited with code != 0.") + exit(1) + handles.wait(timeout=1) + else: + results = handles.get(timeout=360) tests_with_results = {result.unique_name for result in results} all_tests = {test.unique_name for test in tests}