Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/tui/test_pilot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
7 changes: 6 additions & 1 deletion tests/unit/test_env_executors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down