Repository navigation
Fix the Dashboard CI job's two flakes - #3
Merged
Merged
Conversation
… tests The search test waited until the fake endpoint had recorded `search=desk` and then read the rows. The endpoint records a request before it answers, so at that moment the page still held page 2 of everything, [3, 4], until the answer landed — which is the AssertionError main's CI failed with on Oct 28 (`expected [ 3, 4 ] to deeply equal [ 1, 3 ]`). The category test had the same race on the same rows, and its clear waited for rows that are [1, 2] on both sides of it, so that wait proved nothing. Each step now waits on what the answer changes: the rows, or for the clear, the page count (two pages of category 1, three of everything). The page-2 setup steps wait on page 2's rows too, so each change starts from a settled page. What the tests assert is unchanged. Verified by adding a 100 ms delay to the fake endpoint: before, the search and category tests fail every time with exactly CI's [3, 4]; after, all five pass at 100 ms and at 400 ms, and `npm test` passes 15 of 15 three runs running. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…passes
The smoke test runs against the dev server, which compiles each module the
first time a browser asks for it. On a GitHub runner a page's first visit took
longer than the five seconds `toHaveText` waits, so its test failed with the
page still on its loading screen. And it never recovered: a failed test makes
Playwright replace its worker, the new worker starts a new Nuxt, and Vite
("Re-optimizing dependencies because vite config has changed") starts cold
again. In run 42091746069 that was all nine page tests failing on both
attempts, while the three tests after them, on a server the toast test had
warmed, passed in about 3 s each.
A production build would remove the compiling, but it would also remove what
half the page tests look for: Vue only warns in development. So the dev server
stays, and `test/e2e/fixtures.ts` extends @nuxt/test-utils' `test` with a
worker-scoped auto fixture that, once the worker's Nuxt is up, opens each page
in a browser of its own with the API stubbed and waits for its title. It
asserts nothing and swallows nothing a test would see: a page that never draws
here is left for its own test to report. The page list moves there, so the
warm-up and the tests visit the same pages. No assertion or timeout in
smoke.e2e.ts changes.
Verified locally with the Vite cache removed, and with the run put on macOS's
background QoS (`taskpolicy -b`) to stand in for a slow runner. Before: 9
failed, 3 passed in 8.2 minutes, CI's exact pattern. After: 12 passed (one
needed its retry at that throttle) in 2.7 minutes. At normal priority 12 of 12
pass from cold in 25 s. Taking vue-sonner's stylesheet out still fails the
toast test with "viewport ratio 0". Lint and the typecheck pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The Dashboard job has been red on
mainsince the Oct 28 merge, and flaked on #2, which doesn't touch the dashboard. There were two separate causes, one commit each.Vitest:
expected [ 3, 4 ] to deeply equal [ 1, 3 ](run 40786866495)useProductList.spec.tswaited for the fake endpoint to record the search request, then read the rows. The endpoint records before it answers, so the page could still hold the previous page 2,[3, 4]. The category test had the same race, and its clear waited on rows that are[1, 2]both before and after. Each step now waits on what the answer changes. Assertions are unchanged.Playwright: nine "renders its title" tests failing on both attempts (run 42091746069)
The dev server compiles each module on first request. A cold runner took longer than the 5 s
toHaveTextwait. Each failure then replaced the worker, which started a new Nuxt, and Vite re-optimized and started cold again. One slow page became every page failing.A production build isn't an option, because Vue only warns in development and the suite asserts no
[Vue warn]. Sotest/e2e/fixtures.tsadds a worker-scoped auto fixture. Once Nuxt is up, it visits every page with the API stubbed and waits for its title. No assertion or timeout insmoke.e2e.tschanges.taskpolicy -b(throttled CPU), cold cache. Before: 9 failed, 3 passed, 8.2 min (CI's exact pattern). After: 12 passed, 2.7 min.npm run lint,npm run typecheck,npm testandnpm run test:e2eall pass locally.🤖 Generated with Claude Code