From 0d5d8f4521f76f17b2dd8a8cfc8d892e0a650299 Mon Sep 17 00:00:00 2001 From: dejay-vu <39611884+dejay-vu@users.noreply.github.com> Date: Tue, 14 Jul 2026 01:37:54 +0100 Subject: [PATCH 1/2] test: harden process exit checks --- tests/unit/test_env_executors.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/unit/test_env_executors.py b/tests/unit/test_env_executors.py index af92236..cea3de8 100644 --- a/tests/unit/test_env_executors.py +++ b/tests/unit/test_env_executors.py @@ -139,12 +139,17 @@ def _prepare( def _wait_for_process_exit(pid: int, *, timeout: float = 5.0) -> None: + if pid <= 0: + pytest.fail(f"invalid process ID: {pid}") + deadline = time.monotonic() + timeout while time.monotonic() < deadline: try: os.kill(pid, 0) - except OSError: + except ProcessLookupError: return + except OSError as exc: + pytest.fail(f"unable to inspect background process {pid}: {exc}") time.sleep(0.05) pytest.fail(f"background process {pid} did not exit within {timeout:.1f}s") From 6f4bccba04f5ace769450b2b69b566ce67b75e35 Mon Sep 17 00:00:00 2001 From: dejay-vu <39611884+dejay-vu@users.noreply.github.com> Date: Tue, 14 Jul 2026 23:16:25 +0100 Subject: [PATCH 2/2] test(tui): wait for GC confirmation callback --- tests/tui/test_pilot.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/tui/test_pilot.py b/tests/tui/test_pilot.py index 823b4a7..3a67e08 100644 --- a/tests/tui/test_pilot.py +++ b/tests/tui/test_pilot.py @@ -584,6 +584,7 @@ async def test_gc_previews_before_deleting(self, ctx, remote_root): await pilot.press("2") await _wait_for(lambda: isinstance(app.screen, EnvsScreen)) await pilot.press("g") + await _wait_for(lambda: isinstance(app.screen, ConfirmModal)) await pilot.pause() assert isinstance(app.screen, ConfirmModal) app.screen.query_one("#yes")