Skip to content

test: remove bootstrap test that hangs locally#309

Merged
stickerdaniel merged 1 commit into
mainfrom
fix/remove-hanging-bootstrap-test
Apr 4, 2026
Merged

test: remove bootstrap test that hangs locally#309
stickerdaniel merged 1 commit into
mainfrom
fix/remove-hanging-bootstrap-test

Conversation

@stickerdaniel
Copy link
Copy Markdown
Owner

@stickerdaniel stickerdaniel commented Apr 2, 2026

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

  • uv run pytest tests/ -n auto -q — 370 passed in 3.6s, no hang
  • uv run pytest tests/test_bootstrap.py -v — completes without hanging
  • uv run ruff check . — passes
    Prompt: check issue #304 → investigated hanging tests → removed broken test

Copilot AI review requested due to automatic review settings April 2, 2026 21:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_setup side effects.
  • Removed the now-unused asyncio import from tests/test_bootstrap.py.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 2, 2026

Greptile Summary

Removes test_cancelled_setup_task_retries_cleanly, a test that called ensure_tool_ready_or_raise without mocking _run_browser_setup, causing it to spawn a real patchright install chromium subprocess and hang the event loop indefinitely outside of xdist. The unused import asyncio is correctly cleaned up alongside the removal.

Confidence Score: 5/5

Safe 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

Filename Overview
tests/test_bootstrap.py Removed the hanging test_cancelled_setup_task_retries_cleanly test and the now-unused import asyncio; all remaining tests are well-isolated with mocks or MagicMock stubs.

Sequence Diagram

sequenceDiagram
    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 ✓
Loading

Reviews (4): Last reviewed commit: "test: remove bootstrap test that hangs l..." | Re-trigger Greptile

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.
@stickerdaniel stickerdaniel force-pushed the fix/remove-hanging-bootstrap-test branch from 1262e90 to a68e8a0 Compare April 3, 2026 08:00
Copy link
Copy Markdown
Owner Author

stickerdaniel commented Apr 4, 2026

Merge activity

  • Apr 4, 11:27 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 4, 11:27 PM UTC: @stickerdaniel merged this pull request with Graphite.

@stickerdaniel stickerdaniel merged commit 925ffee into main Apr 4, 2026
5 checks passed
@stickerdaniel stickerdaniel deleted the fix/remove-hanging-bootstrap-test branch April 4, 2026 23:27
Naman-B-Parlecha pushed a commit to Naman-B-Parlecha/linkedin-mcp-server that referenced this pull request Apr 17, 2026
## 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants