Skip to content

test: stop the Nuxt demo's e2e specs from restarting each other's mock sign-in - #2583

Merged
fforootd merged 1 commit into
mainfrom
claude/demo-nuxt-mock-one-flow
Nov 2, 2026
Merged

fforootd merged 1 commit into
mainfrom
claude/demo-nuxt-mock-one-flow

Conversation

@fforootd

@fforootd fforootd commented Nov 2, 2026

Copy link
Copy Markdown
Member

Summary

demo-nuxt-mock failed on #2558's lanes-turbo (run 41368286543). In auth.spec.ts, Sign in was clicked and /admin never came. Vite was not the cause. The cause is that the specs shared one mock flow across two workers.

  • The standalone api-mock keeps a single flow, and every POST /flow restarts it (packages/api-mock/src/handlers.ts). Every page that mounts <zitadel-login> sends one. That includes auth-guard.spec.ts, after /admin redirects it to /login.
  • The lane had no workers setting, so CI ran "3 tests using 2 workers". demo-next-mock has pinned workers: 1 for this reason since fix: return to the protected route after sign-in #2055.
  • The failed test's trace: POST /flow, then the identifier submit answered password (tok_mock_2). The password submit, 291 ms later, answered password again (tok_mock_2), without the identifier block. After that, no /sessions/exchange and no navigation. The page snapshot shows the password step with hunter2 still filled in.
  • The 100 ci-turbo runs since 2026-11-01 00:33 UTC include three more failures of this lane, all with the same trace: runs 41260624238, 41270913498 and 41270914423 (the last two in the merge queue, for feat: serve the API under /api/v1 and deprecate the root paths #2358 and feat!: call the API under /api/v1 #2359).

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_B7002 and dependencies optimized: dompurify, liquidjs, lit, … both come during the warm-up project from #2489, before any spec runs. The failed spec loaded the already-optimized lit and saw no reload.

Validation

  • Replayed CI's request order with curl against a standalone api-mock (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 answers done.
  • On 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 and fill timed out. With --workers=2 --repeat-each=10 it passed: on an idle Mac the window needs CI's timing.
  • With this change, moon run e2e:demo-nuxt-mock -- --repeat-each=10 three times, the first cold (.nuxt and the Vite cache removed): "21 tests using 1 worker", 21 passed each time (29.3 s, 26.2 s, 28.2 s).
  • Cold, under CPU load, with this change: 300 perl busy loops and --repeat-each=5 gave 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

  • Specs now run one after another, so the lane takes about the length of auth-guard.spec.ts longer.
  • Not changed: the demo's vite.optimizeDeps.include: ["lit"] still never resolves. lit is a dependency of @zitadel/components, not of apps/demo-nuxt.
  • What DEBUG=vite:deps shows on a cold run:
    • The startup scan crawls only Nuxt's 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 only errx and nostics.
    • The warm-up's page then finds lit and the rest. Vite re-optimizes with "optimized dependencies unchanged", the branch that does not reload.
    • Under 450 busy loops this happened twice inside the warm-up (lit/directives/class-map.js alone the second time), both before the first spec.
  • Pointing optimizeDeps.entries at 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.
  • Reading logs: Vite 8 logs dependencies optimized:, but Nuxt 4.5's hint matches only new dependencies optimized:. Nuxt also drops Vite's optimized dependencies changed. reloading line. So a nuxt dev log cannot show whether a page reloaded.

🤖 Generated with Claude Code

…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>
@vercel

vercel Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cloud Ready Ready Preview Nov 2, 2026 2:33am UTC

Request Review

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

⚠️ No Changeset found

Latest commit: fe36255

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@fforootd
fforootd marked this pull request as ready for review November 2, 2026 03:15
Copilot AI balanced review requested due to automatic review settings November 2, 2026 03:15
@fforootd
fforootd added this pull request to the merge queue Nov 2, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-11-02T03:17:41.015496Z fe36255 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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: 1 in e2e/demo-nuxt/playwright.config.mts so 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

Merged via the queue into main with commit 77f0ae0 Nov 2, 2026
23 checks passed
@fforootd
fforootd deleted the claude/demo-nuxt-mock-one-flow branch November 2, 2026 03:20
@github-project-automation github-project-automation Bot moved this from Inbox to Done in Engineering Kanban Nov 2, 2026

This branch was successfully deployed

1 active deployment
Preview — fe362555 Deployed Nov 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants