Skip to content

test(browser): fix stall, relay and Chrome startup flakes under load - #255

Merged
ElbertePlinio merged 9 commits into
mainfrom
fix/251-browser-load-flakes
Oct 6, 2026
Merged

ElbertePlinio merged 9 commits into
mainfrom
fix/251-browser-load-flakes

Conversation

@ElbertePlinio

@ElbertePlinio ElbertePlinio commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Three browser tests no longer flake on a loaded host. A pre-identity fixture now uses a pid that can never exist.

The stall test's 500 ms timeout used to start before the fake Chrome had run. A spy now holds the starting-browser record write until the fake has logged its stall, so the timeout always measures a stalled fake. The relay test's 100 ms EOF grace also covered the child's Node startup. It is now 10 s, and a passing run never waits on it. The pre-identity fixture uses pid 4194305, above the kernel limit of 4194304.

In CI, the first real Chrome launch on a fresh runner took 1.4 to 39 s and three times went past the 45 s budget. In those failures Chrome published its DevTools port, but the HTTP endpoint never answered. Every later launch took about 1 s, even from a separate process. The cause is not confirmed. The integration suite now warms Chrome once in a beforeAll hook with its own 120 s budget, so each test's 45 s budget measures a warm start. The hook deletes its temp registry only after cleanup is confirmed, and it keeps the registry and fails visibly otherwise. This cannot be reproduced locally, so CI on this PR is the real check.

Closes #251

Requirement Verification Scenario Result Evidence
Stall budget holds on a loaded host Automated test Pinned to 2 CPUs with 32 busy loops origin/main 0/6, branch 10/10 251/after-final-stall-2cpu-32burn.log
Relay shutdown budget holds on a loaded host Automated test Same load origin/main 0/6 (SIGTERM), branch 10/10 251/after-final-relay-2cpu-32burn.log
Find why Chrome startup exceeds 45 s in CI CI log analysis 3 failed and 17 passing CI attempts Only the first launch is slow, cause unconfirmed; warm-up hook added 251/ci-logs/first-chrome-start-timings.txt
Warm-up keeps its cleanup record when cleanup fails Fault injection Teardown throws with Chrome and Xvfb alive Registry kept and hook fails; deleted on confirmed cleanup 251/review-fixes/fault-*.log
Impossible pid in the pre-identity fixture Automated test pid above PID_MAX_LIMIT Pass; product reports it dead and finishes cleanup 251/pid-limit.txt
Full suite with browsers required PICKFORGE_REQUIRE_BROWSER=1 bun run test:coverage Final head 2888 tests pass, thresholds met 251/test-coverage-2.log

Evidence lives in ~/Artifacts/pickforge-kickoff-2026-10-06/ on the dev host. The QA pass was skipped because this is a test-only change with nothing to drive.

Delete the warm-up registry and profile only when no session record keeps
a process identity or a pending cleanup mark. Otherwise fail the hook and
name the kept directory. Reword the startup stall comment to the CI
observation only, since the cause is not confirmed.
@ElbertePlinio
ElbertePlinio merged commit 66d4ae6 into main Oct 6, 2026
10 checks passed
@ElbertePlinio
ElbertePlinio deleted the fix/251-browser-load-flakes branch October 6, 2026 14:52
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.

test: browser stall, relay and Chrome startup tests flake under load

1 participant