Skip to content

Give the Playwright app fixture its own timeout - #309

Merged
frewsxcv merged 1 commit into
mainfrom
fix/playwright-fixture-timeout
Oct 8, 2026
Merged

frewsxcv merged 1 commit into
mainfrom
fix/playwright-fixture-timeout

Conversation

@frewsxcv

@frewsxcv frewsxcv commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes a Playwright flake where a test times out in beforeEach while waiting for the app to start, e.g. add-layer-window.spec.ts › "expanding Russia folder shows Country entry" on #307 and a add-layer-window test in the #303 merge queue run. In both cases the test failed on its retry too.

The appPage fixture's setup time counted against each test's default 30 s timeout. In CI, startup is slow because the page's main thread is saturated while three workers run in parallel. In the #307 report, every trivial page.evaluate took 0.5–1 s. Timings from that report:

  • Fixture setup: median 13.7 s
  • Before hooks: up to 35 s, even in a run where every test passed

Tests with longer bodies already have test.setTimeout(60000). Tests with short bodies, like the add-layer-window ones, had no headroom.

Changes

  • appPage now has its own fixture timeout of 120 s, so startup no longer counts against the test's timeout.
  • The wait for the ready title is raised from 30 s to 60 s, now that it isn't limited by the test timeout.
  • CI uploads www/test-results/ as playwright-test-results when the first Playwright run fails. Today the --update-snapshots re-run clears that directory, so the retry traces of the original failure were lost.

Testing

  • Checked the timeout behavior with a standalone spec that has a 35 s fixture. With the shared timeout, it fails with the same "Test timeout of 30000ms exceeded" error CI showed. With its own timeout, it passes, including when followed by a beforeEach.
  • CI=1 npx playwright test add-layer-window smoke passes locally (14/14).

App startup takes ~14 s in CI (and up to ~35 s) because the page's main
thread is saturated while workers run in parallel. That time counted
against each test's default 30 s timeout, so tests with short bodies
flaked in their beforeEach hooks waiting for the app to become ready.

Also upload test-results/ after a failed run, before the
--update-snapshots re-run clears it, so traces of failures are kept.
@frewsxcv
frewsxcv enabled auto-merge October 8, 2026 22:20
@frewsxcv
frewsxcv added this pull request to the merge queue Oct 8, 2026
Merged via the queue into main with commit 51faa87 Oct 8, 2026
3 checks passed
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.

1 participant