Repository navigation
Todo
Description
Context
Tracking issue for the static test wait/timing audit of 5,331 Rust test functions in crates/, tests/ and xtask/ on 2026-11-26.
Full inventory: test-wait-audit.md
The audit is mechanical. It was sampled (43 rows; 7 suspicious items checked) and the classifier was corrected for production-code sleeps, comment text, let elapsed bounds, long while conditions and loop-body scope. It has not been reviewed row by row; E / E? / X / T / S are keyword and context matches.
Counts
| Set | Count |
|---|---|
| Parsed test functions | 5,331 |
| Listed rows | 1,566 |
Direct/helper sleep |
1,133 |
E (in-process state poll) |
697 |
E? (one-shot/generic in-process wait) |
121 |
N (absence assertion after sleep) |
33 |
X (external process/file/CLI poll) |
183 |
M (machine-sensitive time constraint) |
327 |
D (debug-only) |
39 |
P (measurement/benchmark) |
4 |
G (hang guard only) |
472 |
O (unclassified) |
90 |
Follow-ups
- tests: convert in-process polling waits to event waits #2215 tests: convert in-process polling waits to event waits (
E/E?/N) - tests: replace external process/file polling waits with exit or output events #2216 tests: replace external process/file polling waits with exit or output events (
X) - tests: separate machine-sensitive wall-clock bounds from hang guards #2217 tests: separate machine-sensitive wall-clock bounds from hang guards (
M) — one slice merged in test(hooks): wait for async hook markers instead of sleeping #2224; the rest of theMinventory remains - ci: separate debug-only and measurement tests from ordinary workspace verification #2218 ci: separate debug-only and measurement tests from ordinary workspace verification (
D/P) — completed by test(ci): isolate debug-only CLI acceptances #2223
Method
- Inventory generated by parsing test bodies, direct
sleepcalls, in-scope sleep-bearing test helpers,timeoutcalls andelapsed()comparisons. - Helper calls resolve only inside the same test scope; production methods in
src/are excluded. Mis not assigned to tests whose only time control isstart_paused, unless the same test also has a real bound or a short timeout.Gcoverssoon/patientand explicit timeouts above 5 s.
Out of scope
- Product behavior changes; this is test-infrastructure work.
- Re-reporting individual flakes already fixed in transport_flow: collaboration stop test is timing-sensitive under full-workspace load #291, cli: the ACP recovery-deadline flow races a fixed 40 s poll on loaded runners #807, Test: the extensions undeclared-read test's 50 ms startup timeout races CI load #836, Scheduler tests can only move time by sleeping, because the crate reads the wall clock directly and waits in real time #1536, Two occupying-burst integration cases fail together on one runner: their wait measures the machine, not the burst #1593, CI: resolve repeated transport_flow timeouts at the 600-second target deadline #1728, Four flow tests fail on their hang guards, not on behavior #1814, ci/perf: unlock test parallelism, optimize hot dev third-party crates, cache windows-cli, and trim slow tail tests #1935, branch_flow tests can time out in tool_call when the capabilities suite runs loaded #2047, The Session restore progress test fails its one-second opening bound on a stalled runner #2193.
- Running the 4 measurement harnesses in ordinary CI; they stay
#[ignore].
First wave
- tests: convert in-process polling waits to event waits #2215 batch 1:
branch_flow::until_eventsand its callers — completed by test(branch-flow): wait for committed events in until_events #2244 - tests: replace external process/file polling waits with exit or output events #2216 batch 1:
cli_daemon_flowCLI wait/spawn harness — completed by test(cli): wait for child exit without polling #2251 - tests: separate machine-sensitive wall-clock bounds from hang guards #2217 batch 1:
mcp_session_flow5 s guards, after tests: convert in-process polling waits to event waits #2215 batch 1
The per-issue batching tables are in #2215, #2216 and #2217.
Not planned
- Scheduler RPC waits (
session_flow,loop_flow,wakeup_flow): bounded polling retained; test(scheduler): wait for run settlement through the activity signal #2305 / test(scheduler): signal when a run releases process activity #2309 / fix(scheduler): release a run activity on every terminal path #2313 closed as not planned. See tests: convert in-process polling waits to event waits #2215.
Activity
eric8810 commentedon Nov 26, 2026
Baseline and rough impact estimate for the four child issues.
Baseline (last 300
ci.ymlruns in the localgh run listwindow, 2026-10-30 to 2026-11-26):Sample of 28 failed runs with logs:
minimal_executionoccupying bursts,managed_oauth_flow,daemon_replacetwo-starting-clients,extensionsstartup timeout,agents::sessionsinitialization timeout, MCP handshake timeout.fork_checks_rest_points_without_scanning_completed_history(5 runs; its 30 s wait lives in a helper) andextensions::missing_dependency...(2 s builder timeout). So the timing share above is likely a lower bound.xtask scenario_eval: 6 / 28 runs, including two runs with ~46 failures. These are eval-tool tests, not the four issues below.Estimate:
A realistic range for the four issues is 10–20% relative reduction in completed failure rate (roughly 2–4 points on PRs, 6–11 points on main pushes), assuming the fixes cover 50–80% of the timing-only failures. The effects are not additive:
E/Moverlap heavily, andD/Pmainly remove wall time unless the debug-only tests are the ones failing.The estimate excludes:
scenario_evalcluster, which is outside these four issues;