Skip to content

Stabilize Python background IPC holder test#122

Draft
t-kalinowski wants to merge 2 commits into
mainfrom
stepper/wyxv
Draft

Stabilize Python background IPC holder test#122
t-kalinowski wants to merge 2 commits into
mainfrom
stepper/wyxv

Conversation

@t-kalinowski

@t-kalinowski t-kalinowski commented Jun 18, 2026

Copy link
Copy Markdown
Member

Linked issue: wyxv

Summary

Stabilizes the Python background IPC holder teardown tests by replacing the sleep-based holder fixture with explicit ready, release, and exited synchronization.

Public-facing changes: none. This is a test-only change.

Internal-only changes:

  • Add a deterministic background IPC holder probe for Python backend tests.
  • Update the quit and respawn background IPC tests so they assert server responsiveness while the holder is still blocked.
  • Release background holders during cleanup so early returns and assertion failures do not leave the helper polling deleted temp paths.

Validation

  • cargo check
  • cargo build
  • python3 tests/run_integration_tests.py --binary target/debug/mcp-repl
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --quiet
  • cargo +nightly fmt

Risks / Rollback

Risk is limited to test behavior. If the fixture introduces a regression, revert the test-only commits on this branch.

Screenshots / Videos

Not applicable; this is a backend test-only change.

Finding:
[P2] Ensure the IPC holder is released on early failures — /Users/tomasz/.stepper/mcp-repl/stepper-1/tests/python_backend.rs:856-857: When any path after `arm_background_ipc_holder()` exits early, for example a later `write_stdin_raw_with(...).await?` error or assertion panic, this loop has no timeout and the `TempDir` is dropped without writing `holder-release`, so the Python child keeps polling a deleted path and can be left orphaned in CI or on a developer machine. Add a cleanup guard/Drop release or avoid unguarded `?`/panics after arming so the release marker is always written.

Response:
BackgroundIpcHolderProbe now writes the release marker from Drop and waits with a bounded synchronous poll before its TempDir is removed, while preserving the explicit async release path for normal test cleanup.
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.

1 participant