test: remove bootstrap test that hangs locally#309
Conversation
There was a problem hiding this comment.
Pull request overview
Removes a locally hanging bootstrap test that could spawn a real browser-install subprocess and leak a background task, blocking the event loop in non-xdist runs.
Changes:
- Removed
test_cancelled_setup_task_retries_cleanly, which could trigger real_run_browser_setupside effects. - Removed the now-unused
asyncioimport fromtests/test_bootstrap.py.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Greptile SummaryRemoves Confidence Score: 5/5Safe to merge — removes a single broken test with no production-code changes. The change is purely a test deletion plus a now-unused import removal. No logic changes, no new risks, and the removed test was actively causing suite hangs. The marginal scenario it covered (retry after cancelled setup task) remains partially addressed by existing tests. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant T as Test
participant E as ensure_tool_ready_or_raise
participant B as _run_browser_setup
participant P as patchright subprocess
Note over T,P: Removed test — problematic flow
T->>T: create_task(sleep(10)) → cancel → await CancelledError
T->>T: state.setup_task = cancelled_task
T->>E: ensure_tool_ready_or_raise("search_jobs")
E->>B: cancelled task detected → restart setup
B->>P: spawn "patchright install chromium"
P-->>B: (never returns — hangs event loop)
Note over T,P: Remaining tests — properly mocked
T->>T: state.setup_state = RUNNING, setup_task = MagicMock(done=False)
T->>E: ensure_tool_ready_or_raise("search_jobs")
E-->>T: raises BrowserSetupInProgressError ✓
Reviews (4): Last reviewed commit: "test: remove bootstrap test that hangs l..." | Re-trigger Greptile |
7d545ab to
1899f5a
Compare
1899f5a to
1262e90
Compare
Remove test_cancelled_setup_task_retries_cleanly which spawns a real patchright install subprocess as a side effect, causing the test suite to hang indefinitely without -n auto. The scenario it covers (retry after cancelled setup task) is marginal and partially covered by existing tests.
1262e90 to
a68e8a0
Compare
Merge activity
|
## Summary - Remove `test_cancelled_setup_task_retries_cleanly` which calls `ensure_tool_ready_or_raise` without mocking `_run_browser_setup`, spawning a real `patchright install chromium` subprocess as a side effect - This causes the test suite to hang indefinitely when run without `-n auto` (xdist), as the leaked background task blocks the event loop - The scenario it covers (retry after cancelled setup task) is marginal and partially covered by `test_setup_in_progress_raises` and `test_reset_bootstrap_cancels_running_tasks` ## Test plan - [x] `uv run pytest tests/ -n auto -q` — 370 passed in 3.6s, no hang - [x] `uv run pytest tests/test_bootstrap.py -v` — completes without hanging - [x] `uv run ruff check .` — passes Prompt: `check issue stickerdaniel#304` → investigated hanging tests → removed broken test
Summary
test_cancelled_setup_task_retries_cleanlywhich callsensure_tool_ready_or_raisewithout mocking_run_browser_setup, spawning a realpatchright install chromiumsubprocess as a side effect-n auto(xdist), as the leaked background task blocks the event looptest_setup_in_progress_raisesandtest_reset_bootstrap_cancels_running_tasksTest plan
uv run pytest tests/ -n auto -q— 370 passed in 3.6s, no hanguv run pytest tests/test_bootstrap.py -v— completes without hanginguv run ruff check .— passesPrompt:
check issue #304→ investigated hanging tests → removed broken test