Flaky test: mcp_smoke wait_for_initial_scan races on macOS #33
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally filed by @coilysiren on 2026-05-15T07:43:29Z - https://github.com/coilysiren/repo-recall/issues/175
Symptom
tests/mcp_smoke.rs::refresh_runs_and_bumps_scan_versionandtests/mcp_smoke.rs::dashboard_returns_structured_payloadare flaky on macOS local. Both panic atwait_for_initial_scanwith the 20s deadline expiring before the spawned binary's initial background scan bumpsscan_versionpast 0.Run A (failed)
Run B (passed, no code change between A and B)
Run C (failed again) - same panic shape as Run A.
Candidate causes
wait_for_initial_scanpolls every 50ms with a 20s wall-clock deadline (tests/mcp_smoke.rs:274). The comment says "~10s for the scan body plus a tantivy commit on a fresh index" - on a busy machine the scan body plus a freshly-built index can clearly drift past that.github_client.fetch_user().awaitHTTP call (bounded to 3s) for the auth probe. Worst-case adds 3s to startup, which combined with a slow tantivy commit could push the test past the 20s deadline.cargo testinvocation. They each spawn their ownrepo-recallbinary - resource pressure (file descriptors, redb lock contention via $TMPDIR siblings) could compound.Suggested fix
Either bump the
wait_for_initial_scandeadline to 30-45s, or add a "scan complete" stdout marker the test can wait for instead of pollingscan_version. CI on Linux passes consistently per recent green runs onmain, so the flake is platform/load-shaped, not a bug in the scan path itself.Where
Discovered while landing #174.