From 488ae0445945ab8d9cade2b63027a6c33649355b Mon Sep 17 00:00:00 2001 From: Ed_ Date: Mon, 8 Jun 2026 02:03:50 -0400 Subject: [PATCH] fix(run_tests_batched): detect batch failure from output when proc.returncode is wrong --- scripts/run_tests_batched.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/run_tests_batched.py b/scripts/run_tests_batched.py index 747ed86f..13d06708 100644 --- a/scripts/run_tests_batched.py +++ b/scripts/run_tests_batched.py @@ -154,11 +154,14 @@ def _run_batch(b: Batch, durations: dict[str, float]) -> tuple[int, float, dict[ proc.wait() elapsed = time.monotonic() - t0 new_durs = _parse_durations_from_pytest_output("".join(captured)) - if proc.returncode == 0: + captured_text = "".join(captured) + saw_failure = "FAILED " in captured_text or " stopping after " in captured_text + effective_code = proc.returncode if proc.returncode != 0 else (1 if saw_failure else 0) + if effective_code == 0: print(_c(f"<<< {b.label} PASS in {elapsed:.1f}s", _C.BOLD_GREEN)) else: - print(_c(f"<<< {b.label} FAIL (exit {proc.returncode}) in {elapsed:.1f}s", _C.BOLD_RED)) - return proc.returncode, elapsed, new_durs + print(_c(f"<<< {b.label} FAIL (exit {effective_code}) in {elapsed:.1f}s", _C.BOLD_RED)) + return effective_code, elapsed, new_durs def _print_summary(results: list[tuple[Batch, int, float]]) -> int: print()