Skip to content

test: remove wall-time and startup assumptions from CLI and MCP tests - #303

Merged
ElbertePlinio merged 6 commits into
mainfrom
fix/259-268-274-296-cli-mcp-test-timing
Oct 8, 2026
Merged

ElbertePlinio merged 6 commits into
mainfrom
fix/259-268-274-296-cli-mcp-test-timing

Conversation

@ElbertePlinio

@ElbertePlinio ElbertePlinio commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Four CLI and MCP test timing bugs fixed in test code only.

#296: both fake adb scripts (CLI and MCP test helpers) used cat to stop the fake emulator, but cat was not on the fake's PATH. Every Android destroy then waited the full 30 s grace. They now use the shell's read builtin. A fake destroy went from 31.4 s to 0.34 s, so the commands test destroy limit went from 45 s to 20 s and its cleanup hook timeout from 90 s to 60 s.

#259: the viewer mode test asserted the CLI returned within 8 s of wall time. The fake browser now stays open until the test releases it, and records when it exits. The test checks that the CLI returned while the browser was still open, without a wall-time bound.

#274: the MCP stdio conformance helper gave the first wait after a spawn the same 5 s bound as every later frame. That first wait now gets a 30 s startup budget, and later waits keep 5 s.

#268: the live desktop input test waited for a stable caret with an 8 s timeout. That bound existed because GTK stops a caret blinking after 10 s, after which it looks stable. The fixture now sets gtk-cursor-blink-timeout=600, so a stable result still proves the blink is off, and the timeout went to 30 s.

Closes #259
Closes #268
Closes #274
Closes #296

Requirement Verified by Scenario Result Evidence
#296 fake adb stops the emulator without cat Timing measurement Fake destroy before and after; four Android lifecycle tests 31.4 s to 0.34 s; 107 s to 32 s ~/Artifacts/pickforge-batch3-2026-10-08/worker-C-report.md
#296 lower the destroy limit and hook timeout Full file run commands.test.ts with the 20 s limit 64 of 64; max cleanup destroy 6.4 s ~/Artifacts/pickforge-batch3-2026-10-08/worker-C-report.md
#259 check independent of load Repeat runs 10 busy loops on 2 pinned CPUs Old failed 3 of 3 (13.5 to 16.1 s); new passed 6 of 6 ~/Artifacts/pickforge-batch3-2026-10-08/worker-C-report.md
#274 startup budget for the first read only Repeat runs 10 loops on 2 CPUs; measured startup up to 8.8 s Old: 5 to 10 of 16 tests failed per run; new 96 of 96 ~/Artifacts/pickforge-batch3-2026-10-08/worker-C-report.md
#268 stable wait sized for load without weakening it Repeat runs, negative check 55 loops on one CPU; blink left on Old timed out 3 of 3; new stable 5 of 5. With blink on, the wait still times out (2 of 2) ~/Artifacts/pickforge-batch3-2026-10-08/worker-C-report.md
Repo checks lint, typecheck, build, PickCheck, coverage Head 4c97929 on a quiet host All pass; 2968 tests, thresholds hold ~/Artifacts/pickforge-batch3-2026-10-08/259-268-274-296-cli-mcp-test-timing-cov.log

QA device pass: skipped. The change is test code only, so there is nothing to drive.

The fake adb in the CLI and MCP tests read the emulator pid with cat.
Tests that do not use the real PATH have no cat, so emu kill did nothing
and every Android destroy waited the full 30 s exit grace. The fake now
reads the pid with the read builtin. A fake Android destroy drops from
about 31 s to about 0.35 s.

The commands test destroy limit drops from 45 s to 20 s and its cleanup
hook timeout from 90 s to 60 s, since no destroy needs the grace now.

Closes #296
The auto viewer test asserted that session create returned within 8 s
of a fake browser that slept 10 s. Under CPU load the CLI took 13 to
19 s and the test failed. The fake browser now stays open until the
test releases it and records when it exits. The test checks that the
CLI returned while the browser was still open, then releases it and
waits for its exit.

Closes #259
Each WireProcess wait had a 5 s bound, and the first one after a spawn
also absorbed the server's startup. Server startup took up to 9 s on a
loaded host, and most tests also had vitest's 5 s default timeout, so
5 to 10 of 16 tests failed per run under load.

The first wait after a spawn, whether a frame read, the readiness wait
or an exit wait, now has a 30 s startup budget. Later waits keep the
5 s bound. Each test that spawns the server gets a timeout that covers
one startup plus its frame waits per spawn.

Closes #274
The stable wait before typing had an 8 s timeout, because a live caret
stops blinking after GTK's 10 s blink timeout and would then look
stable. On a loaded host each screenshot sample took 3 to 4 s, so the
wait timed out with one or two samples.

The fixture now also sets gtk-cursor-blink-timeout=600, so a live caret
keeps blinking for 10 minutes. The stable wait then proves the blink is
off at any timeout, and its timeout rises to 30 s. With the blink turned
on, the wait still times out after 30 s. Without the new setting it
would pass after about 11 s.

Closes #268
@ElbertePlinio
ElbertePlinio merged commit 141b0d4 into main Oct 8, 2026
10 checks passed
@ElbertePlinio
ElbertePlinio deleted the fix/259-268-274-296-cli-mcp-test-timing branch October 8, 2026 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant