From 3726b5c53f2291bb17603990a4ea1703a031560b Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Tue, 24 Nov 2026 09:52:43 +0000 Subject: [PATCH] test(scripts): treat a process that exits mid-read as gone Reading /proc//stat raises ProcessLookupError when the process exits between the open and the read, which made the lane-kill tests fail now and then. Assisted-by: Claude Code:claude-opus-5-5 --- tests/scripts/test_run_molecule_scenarios.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/scripts/test_run_molecule_scenarios.py b/tests/scripts/test_run_molecule_scenarios.py index 4a5d005..eff52ea 100644 --- a/tests/scripts/test_run_molecule_scenarios.py +++ b/tests/scripts/test_run_molecule_scenarios.py @@ -353,7 +353,7 @@ def alive(pid): """Whether pid is a running process, not gone or a zombie.""" try: stat = pathlib.Path(f"/proc/{pid}/stat").read_text() - except FileNotFoundError: + except (FileNotFoundError, ProcessLookupError): # gone before or during the read return False return stat.rsplit(")", 1)[1].split()[0] != "Z"