Repository navigation
test: stop the Nuxt demo's e2e specs from restarting each other's mock sign-in - #2583
Conversation
…k sign-in The standalone api-mock drives one flow, and every page that mounts <zitadel-login> restarts it with POST /flow. With two workers in CI, auth-guard.spec.ts restarted the flow between auth.spec.ts's identifier and password submits: the password submit answered the password step again, and the sign-in never reached /admin (lanes-turbo, run 41368286543). Run the lane on one worker, as demo-next-mock already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟢 Approval recommended
No issues were identified in this minimal, test-only change that pins the Nuxt e2e lane to a single worker consistent with the established pattern.
No open issues 🎉
What changed in this PR
This PR fixes flakiness in the Nuxt demo's e2e lane (demo-nuxt-mock). Because the standalone @zitadel/api-mock tracks a single sign-in flow, and every page mounting <zitadel-login> restarts that flow, running specs across multiple Playwright workers let one spec restart or advance another spec's in-progress sign-in — producing intermittent failures where Sign in was clicked but /admin never loaded. The fix pins the lane to a single worker, mirroring the convention already in place for the demo-next-mock lane.
Changes:
- Pin
workers: 1ine2e/demo-nuxt/playwright.config.mtsso specs run sequentially and no longer interfere with each other's shared mock flow. - Add an explanatory comment documenting why a single worker is required.
| File | Description |
|---|---|
e2e/demo-nuxt/playwright.config.mts |
Sets workers: 1 with a comment, matching e2e/demo-next/playwright.config.mts's existing single-worker convention, so parallel workers can't restart/advance each other's single shared api-mock sign-in flow. |
Review effort: Balanced
Summary
demo-nuxt-mockfailed on #2558'slanes-turbo(run 41368286543). Inauth.spec.ts, Sign in was clicked and/adminnever came. Vite was not the cause. The cause is that the specs shared one mock flow across two workers.POST /flowrestarts it (packages/api-mock/src/handlers.ts). Every page that mounts<zitadel-login>sends one. That includesauth-guard.spec.ts, after/adminredirects it to/login.workerssetting, so CI ran "3 tests using 2 workers".demo-next-mockhas pinnedworkers: 1for this reason since fix: return to the protected route after sign-in #2055.POST /flow, then the identifier submit answeredpassword(tok_mock_2). The password submit, 291 ms later, answeredpasswordagain (tok_mock_2), without the identifier block. After that, no/sessions/exchangeand no navigation. The page snapshot shows the password step withhunter2still filled in.The lane now runs on one worker, with a comment like demo-next's.
The late Vite optimization in the log is real, but it is not this failure.
NUXT_B7002anddependencies optimized: dompurify, liquidjs, lit, …both come during the warm-up project from #2489, before any spec runs. The failed spec loaded the already-optimizedlitand saw no reload.Validation
pnpm start,PORT=8091): create, identifier, a second create, password. The last response is JSON-identical to CI's. Without the second create, the password submit answersdone.main,moon run e2e:demo-nuxt-mock -- --workers=6 --repeat-each=10: 2 of 10 sign-ins failed. Here another spec's submit advanced the flow, so the widget skipped the password step andfilltimed out. With--workers=2 --repeat-each=10it passed: on an idle Mac the window needs CI's timing.moon run e2e:demo-nuxt-mock -- --repeat-each=10three times, the first cold (.nuxtand the Vite cache removed): "21 tests using 1 worker", 21 passed each time (29.3 s, 26.2 s, 28.2 s).perlbusy loops and--repeat-each=5gave 11 passed (1.5 min). 450 busy loops gave 3 passed (1.6 min). Both ran on 1 worker.moon run e2e:lint e2e:typecheck: pass.Release notes / changeset
No changeset required — no shipped behavior changed.
Notes
auth-guard.spec.tslonger.vite.optimizeDeps.include: ["lit"]still never resolves.litis a dependency of@zitadel/components, not ofapps/demo-nuxt.DEBUG=vite:depsshows on a cold run:entry.async.js. Nuxt lists the plugins in a virtual module, where the scan stops, so it never reaches the SDK's client plugin and finds onlyerrxandnostics.litand the rest. Vite re-optimizes with "optimized dependencies unchanged", the branch that does not reload.lit/directives/class-map.jsalone the second time), both before the first spec.optimizeDeps.entriesat the SDK's client plugin makes the startup scan find all eleven, following the components' imports with no list to maintain. I probed this; it is not in this PR. It belongs in@zitadel/sdk-nuxt's module, as a change of its own.dependencies optimized:, but Nuxt 4.5's hint matches onlynew dependencies optimized:. Nuxt also drops Vite'soptimized dependencies changed. reloadingline. So anuxt devlog cannot show whether a page reloaded.🤖 Generated with Claude Code