From 7030445c15a00f4b08de4620fdc87ec75f505e49 Mon Sep 17 00:00:00 2001 From: Yuanqiang Liu Date: Mon, 5 Aug 2024 10:41:09 +0800 Subject: [PATCH] [e2e_testing] check process exitcode early in e2e (#3591) It will exit immediately. So it doesn't need to wait 6 min. --- projects/pt1/python/torch_mlir_e2e_test/framework.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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}