Skip to content

fix(ui): stop the app lifecycle tests racing their 500 ms launch deadline - #383

Merged
vishr merged 2 commits into
mainfrom
fix/app-lifecycle-flake
Oct 26, 2026
Merged

vishr merged 2 commits into
mainfrom
fix/app-lifecycle-flake

Conversation

@vishr

@vishr vishr commented Oct 26, 2026

Copy link
Copy Markdown
Member

Closes #377.

What changed

Every app-lifecycle.test.ts fixture gave startAppServer a 500 ms deadline that also covered starting Node. The wrong_pid and wrong_id tests relied on that deadline expiring after the child wrote its files, so under full-suite load the child could still be starting when the launch timed out, and the test then failed reading started.json (ENOENT).

  • startAppServer rejects a readiness record with another launch's id or pid immediately ("Seeded server reported readiness for another launch"). The launch directory is new, so such a record can never become valid. The real app-server.ts writes an env-less record with its own id and pid first; that still waits as before.
  • Fixtures get a 30 s startup deadline that no test waits for.
  • A new test covers the timeout path with a manager that never reports readiness.

Test-support code only; no product change.

Verification

  • just check: all checks passed (pre-push hook)
  • app-lifecycle.test.ts: 10/10 passing across 3 normal runs and 5 runs with all CPUs saturated. The original flake also did not reproduce on the old code under that synthetic load (it appeared once in a full just check), so the fix rests on the code path above rather than a forced reproduction.
  • No credentials, private telemetry, host details, or enterprise-only source are included

vishr added 2 commits October 25, 2026 17:42
…line

Every fixture gave startAppServer a 500 ms deadline that also covered
starting Node. The wrong_pid and wrong_id tests relied on that deadline
expiring after the child wrote its readiness file, so under full-suite
load the child could still be starting when the launch timed out, and
the test then failed reading started.json (#377).

A launch directory is new, so a readiness record with another launch's
id or pid can never become valid. startAppServer now rejects it at once
instead of waiting for the deadline, the fixtures get a 30 s startup
deadline that no test waits for, and a separate test covers the timeout
path with a manager that never reports readiness.

Closes #377
@vishr
vishr merged commit bcd8758 into main Oct 26, 2026
17 checks passed
@vishr
vishr deleted the fix/app-lifecycle-flake branch October 26, 2026 01:31
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(ui): app-lifecycle wrong_id readiness test is flaky under full-suite load

1 participant