Skip to content

test(studio): launch real-Chrome tests like the e2e launcher, bounded by the test budget - #5134

Merged
miguel-heygen merged 3 commits into
mainfrom
fix/studio-test-chrome-launch-budget
Oct 7, 2026
Merged

miguel-heygen merged 3 commits into
mainfrom
fix/studio-test-chrome-launch-budget

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

What

Main's CI went red after #5115 (run 37539574999). Test (studio) failed in gsapUndoRestore.browser.test.ts's beforeAll: TimeoutError: Timed out after 30000 ms while waiting for the WS endpoint URL to appear in stdout! from puppeteer.launch. Test only reports that shard. Nothing #5115 changed runs before that point. Its only change is in core/src/runtime/init.ts.

The two studio tests that start their own Chrome under vitest now share one launcher and one page setup in tests/chromeTestUtils.ts, beside the other test helpers:

  • Launch flags: the same as Studio's e2e launcher (tests/e2e/chrome-executable.mjs): --no-sandbox --disable-dev-shm-usage --disable-gpu. That means no GPU process, and nothing depends on shared memory.
  • Launch timeout: timeout: 0, so the test's own 60 s budget bounds the launch. That budget was set for loaded runners, but puppeteer's 30 s default cut the launch off first.
  • Page setup: serving only the GSAP CDN script, loading the runtime and waiting for the player was copied in both tests. It is now one function.

What I could not prove

This is the only Chrome launch timeout in the last 150 CI runs. Under a full studio suite on 4 workers on a loaded Linux box, the launch took 0.2 to 0.3 s. So the failing launch hung rather than ran slowly. Chrome's own output from the failing run isn't in the CI log, so I can't name the cause. This change gives the launch the flags Studio's other launcher already uses and the full test budget. It does not prove the hang cannot come back.

Checks

  • Both tests and vite.browser.test.ts: 21/21, 3 runs in a row.
  • Full studio suite with --maxWorkers=4: 689 files, 7672 tests pass.
  • Typecheck, lint, format, comment checks and fallow pass.
  • Possible follow-up: dumpio: true on the launch would put Chrome's own output in the log if it hangs again.

No visible change

Test code only: two real-Chrome unit tests and their helper under packages/studio/tests/. Nothing a Studio user sees changes.

Size

Under 100 lines on purpose: it is a lone fix for a red main and should not wait to be bundled with other work.

@miguel-heygen
miguel-heygen marked this pull request as ready for review October 6, 2026 23:31
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Edit accuracy: accurate 2059 (base branch 2059), smooth 1592 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (0)

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked at da0c89b. Test-only change, CI all green (66 pass, 13 skipped).

  • The two browser tests now share tests/chromeTestUtils.ts. Launch, request interception and runtime injection are byte-equivalent to the copies they replace, apart from two things: the added --disable-dev-shm-usage --disable-gpu flags (the same set tests/e2e/chrome-executable.mjs uses) and timeout: 0.
  • timeout: 0 is still bounded: the launch in gsapValueAtPlayhead runs inside a test with testTimeout: 60_000, and the one in gsapUndoRestore runs in beforeAll with hookTimeout: 60_000.
  • Keeping findSystemChrome (rather than the e2e resolveChromeExecutable) keeps the Windows HYPERFRAMES_BROWSER_PATH path these tests already relied on.

Non-blocking:

  • Two test launchers now carry the same flags: this one and launchStudioChrome in tests/e2e/chrome-executable.mjs, which uses a different resolver and calls process.exit(2). Worth folding into one later.
  • If a launch ever hangs, Vitest fails the test while the pending launch can leave a Chrome process alive until the worker exits.

Rames

@miguel-heygen
miguel-heygen added this pull request to the merge queue Oct 7, 2026
Merged via the queue into main with commit 1825c37 Oct 7, 2026
153 of 156 checks passed
@miguel-heygen
miguel-heygen deleted the fix/studio-test-chrome-launch-budget branch October 7, 2026 00:36
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.

2 participants