Finding
rust/aid/tests/interactive.rs fails intermittently on a loaded cargo test --workspace, and passes reliably when the suite is run alone.
Measured on this machine (devcontainer, pixi run cargo test --workspace, main at 9392779):
- suite alone,
cargo test -p aid --test interactive: 3/3 green
- full workspace run: 2 failures in 4 runs
The failure seen was a_pasted_multi_line_prompt_arrives_whole_rather_than_leaking (aid/tests/interactive.rs:315), with "press Enter" never appeared after the 60s deadline in wait_for (:205).
The tests drive the real binary through a pty and poll wait_for at 25ms against a 60s deadline, so they are sensitive to scheduling pressure from the rest of the workspace run. Each also spawns python3 launch_scenario.py to build a scratch world first.
Why it matters beyond the noise
CI green becomes probabilistic, and a real regression in the interactive flow arrives looking exactly like the flake — which is the state in which flakes stop being investigated.
Shape
Unclear, deliberately. Worth establishing first whether the deadline is simply too tight under load, or whether there is a genuine lost-wakeup between the pty reader thread (:148) and wait_for. Options in rough order of cost: raise the deadline, serialise the pty tests against each other, or hand the reader thread a condvar instead of polling.
Found while adding a pty regression test in the DEVLAUNCH_NO_TTY fix; that test is not the cause — the baseline flakes more often without it.
Finding
rust/aid/tests/interactive.rsfails intermittently on a loadedcargo test --workspace, and passes reliably when the suite is run alone.Measured on this machine (devcontainer,
pixi run cargo test --workspace,mainat 9392779):cargo test -p aid --test interactive: 3/3 greenThe failure seen was
a_pasted_multi_line_prompt_arrives_whole_rather_than_leaking(aid/tests/interactive.rs:315), with"press Enter" never appearedafter the 60s deadline inwait_for(:205).The tests drive the real binary through a pty and poll
wait_forat 25ms against a 60s deadline, so they are sensitive to scheduling pressure from the rest of the workspace run. Each also spawnspython3 launch_scenario.pyto build a scratch world first.Why it matters beyond the noise
CI green becomes probabilistic, and a real regression in the interactive flow arrives looking exactly like the flake — which is the state in which flakes stop being investigated.
Shape
Unclear, deliberately. Worth establishing first whether the deadline is simply too tight under load, or whether there is a genuine lost-wakeup between the pty reader thread (
:148) andwait_for. Options in rough order of cost: raise the deadline, serialise the pty tests against each other, or hand the reader thread a condvar instead of polling.Found while adding a pty regression test in the DEVLAUNCH_NO_TTY fix; that test is not the cause — the baseline flakes more often without it.