Repository navigation
tests: faster local e2e runs, fix three CI flakes - #3445
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
david-crespo
commented
Nov 12, 2026
| } | ||
| }).observe(document, { childList: true, subtree: true }) | ||
| }) | ||
| }) |
Collaborator
Author
There was a problem hiding this comment.
This is kinda gnarly? Not sure it's worth it, I would almost rather delete the test than do something like this.
Contributor
There was a problem hiding this comment.
mostly doesn't bother me, although observing the whole document feels silly. you could dispose of the first observer and make a new one once you've found a mutation where the target is the announcer element, but depending on your definition of "gnarly" that's worse than an overactive mutation observer in a test suite!
Collaborator
Author
|
And it still flaked in firefox. Come on. |
Collaborator
Author
|
Added two more flakes fixed to the description. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I looked into speeding up local e2e runs and fixing some flakes we keep seeing in CI. Not sure whether the speedup is worth it here, but it is pretty big for the occasional local full suite run.
Speedup
A Playwright trace is a recording of a test run that you open in the trace viewer: a DOM snapshot before and after each action, plus screenshots, network requests and console output. Locally we ran with
trace: 'retain-on-failure', which records a trace for every test and throws it away when the test passes. Local runs now default tooff; pass--trace retain-on-failurewhen chasing a flake (noted in AGENTS.md and thedebug-e2eskill). CI keepson-first-retry, which only records on retries.Wall-clock time on my 14-core Mac, Chrome only, 9 workers (the local default), with tracing on and off runs interleaved. Times include starting the dev server.
can resize a failed or stopped instance)instance.e2e.ts(19 tests)* The range leaves out a third tracing-off run that took 44.6 s. The median includes it.
I also considered running e2e against the production build. Every test starts in a fresh browser context, so every page load refetches every unbundled module from the Vite dev server. The production build is faster for the full suite: on the Mac, main took 210 s and the production build with tracing off took 154–156 s (two runs each, 402 tests). But the build runs before every invocation, so a single test got slower, 7.9 s against 6.2 s on the dev server, and the break-even is probably somewhere around 20–30 tests. Locally we mostly run one file or one test, and CI runs the full suite. Supporting both dev and prod servers also meant some noisy fixes for 13 tests that assumed the dev server, across 10 files, and e2e would no longer run with StrictMode double effects or React dev warnings. It could still make sense for CI later.
Flakes
support-bundles › bundle deleted mid-view 404sfailed on Firefox in 3 of the last 11 CI runs, once on all three attempts on main. It has 3 s to see the bundle indestroying, and the toast helpers slept 1 s after every dismissal (added in Sleep after closing toast in E2E to reduce flake #1832, nobody knew why). They now wait for the toast to leave the DOM. On Firefox it went from 5/10 passing to 10/10, and 10 toast-heavy specs showed no new failures.vpcs › can nav to VpcPage from /failed its first attempt on Chrome in 7 of the last 11 CI runs. TheVPCslink locator also matched theproject-no-vpcslink in the projects table, still on screen on a slow runner. Withexact: trueand Chrome's CPU throttled 2x, it went from 0/20 passing to 20/20.route-announcer › route announcerfailed on Firefox in 7 of the last 11 CI runs. react-aria removes each announcement after 7 s, before a slow runner gets to the assertion. The test now records announcements as they appear. With a 7.5 s pause added after a nav, the old test failed 5/5 on Firefox and the new one passed 5/5.theme.e2e.ts:99), fixed in app/msw-mock-api.ts.scroll-restore.e2e.ts:12), fixed in test/e2e/utils.ts.