Repository navigation
test: keep the SDK suites and the conformance lane clear of cold-start flakes - #3526
Conversation
The Solid and Svelte keyed-project tests are the first in their files to wait for a rendered step, so they pay the widget's cold first render (LiquidJS, locale, mock flow) inside waitFor's 1 s default; CI runs reach 1.3 s. Give that wait 4 s, inside Solid's 5 s per-test budget. sdk-next's middleware adapter imported ../auth.js inside the first test, which carried the cold module load (CI median 1.8 s, max 4.6 s against 5 s). Import it statically: the file never resets modules and vi.mock is hoisted, so behaviour is unchanged and the first case drops to ~5 ms. No changeset required — no shipped behavior changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmRkyq5frfEBq7svZeP
… test A fixture runs the SDKs linked from the workspace, so its Vite dev server only discovers the widget's dependencies when a browser first imports them, pre-bundles them and reloads the page. That reload landed inside the test; on a slow runner the first attempt timed out, closing the page aborted a pending request, and Vite replayed that error as its overlay on the retry's fresh page, so `retries: 1` could not absorb it. A global setup now loads /login before the first test and waits until the page keeps one document, idle, for 10 s, then closes it with no request in flight. Correct the comment and the AGENTS.md line that said the retry covers the reload. No changeset required — no shipped behavior changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmRkyq5frfEBq7svZeP
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review Summary: ✅ CompletedThis 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.
🟡 Changes recommended
The warm-up can close the page while requests are still pending and treat an incomplete quiet window as success, leaving the dev server unsettled for tests.
2 open issues
What changed in this PR
This PR targets cold-start flakes in the SDK tests and shared conformance lane without changing shipped SDK behavior.
Changes:
- Extends the first rendered-step wait in Solid and Svelte to four seconds.
- Moves the Next.js middleware test’s auth import outside test execution.
- Adds a shared browser warm-up before conformance tests and updates retry guidance.
| File | Description |
|---|---|
packages/sdk-svelte/src/__tests__/index.test.ts |
Allows more time for the widget’s first render. |
packages/sdk-solid/src/__tests__/index.test.tsx |
Allows more time for the widget’s first render. |
packages/sdk-next/src/__tests__/middleware.test.ts |
Imports auth statically to avoid cold loading during the first test. |
conformance/suite/src/warm-up.ts |
Adds a login-page warm-up to absorb dev-server reloads. |
conformance/suite/src/config.ts |
Registers the warm-up and clarifies the retries comment. |
conformance/AGENTS.md |
Updates guidance on warm-up and retry responsibilities. |
Review effort: Balanced
The warm-up watched only navigations in its quiet window, so a request started in it could still be pending when the page closed, and near the end of the budget a shortened window counted as settled. Track every request from before the first load, restart the window on any request or main-frame navigation, close only with none in flight after a full 10 s, and fail naming the open requests when the budget cannot fit one. Event streams, such as TanStack Start's dev-tools console pipe, stay open for the page's life and do not count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmRkyq5frfEBq7svZeP

Context
full-prfailures on 2026-12-01 (runs 46709456301 / job 142864625436 and 46709428765 / job 142864535175, both green on the second attempt). No issue to close.Summary
The three failures have three separate causes. Two share a pattern: a cold first-time load lands inside a tight default timeout.
@zitadel/sdk-solidkeyed-project test ("shows the sign-in step for a project that carries a publishable key")waitFordefault. In React, Vue and Angular, 3–5 earlier tests warm it, and their copy runs in under 300 ms.waitFor4 s, in sdk-solid and sdk-svelte. It stays inside Solid's 5 s per-test budget.@zitadel/sdk-nextfirst middleware case ("public route with no token continues as unauthenticated")readAuthimported../auth.jsdynamically, inside the test, so the first case carried the cold module load.main, build: version packages #3461,fix/safe-redirect-target-validationand feat(api): serve an OAuth client that presents its client ID metadata document #3488 (3 of 103 executions since feat: harden the SDK suites and await async widget callbacks #3448). It predates the stack and doesn't depend on it.verifyJwt … TimeoutErrorline in those logs is a deliberate mocked case injwt.test.ts, not this failure.authstatically. The file never resets modules andvi.mockis hoisted, so behavior is unchanged.@zitadel/conformance-solid-startretries: 1could not absorb the failure.main), then 2 double failures after retries were added (feat: add a user hook to every UI SDK #3492 and feat(api): keep an OAuth client connected with refresh tokens, and serve clients that hold no secret #3495). The reload happened in every execution of the SolidStart and TanStack Start lanes. The replayed overlay was reproduced in isolation on 8.3.8.globalSetup(conformance/suite/src/warm-up.ts, wired insuite/src/config.ts). It loads/loginbefore the first test, tracks every request and main-frame navigation from before the first load, and closes the page only after a full 10 s with no request in flight and no navigation. If 180 s cannot fit one such window it fails, naming the open requests. Event streams (TanStack Start's dev-tools console pipe, for one) stay open for the page's life and do not count. Playwright startswebServerbeforeglobalSetup, andwithZitadel()returns onlywebServer, so the two do not collide.suite/src/config.tsand the line inconformance/AGENTS.md.Validation
vitest run --project browser src/__tests__/index.test.tsx(sdk-solid, 89 passed);vitest run --project browser src/__tests__/index.test.ts(sdk-svelte, 93 passed);vitest run(sdk-next, 277 passed).turbo run lint typecheckfor sdk-next, sdk-solid, sdk-svelte and@zitadel/conformance: pass.pnpm run conformanceinconformance/fixtures/solid-start, withnode_modules/.viteremoved each time: 4/4 pass. Vite's "optimized dependencies changed. reloading" line always comes before "[conformance] warm-up: /login settled", and nothing re-optimizes, reloads or reports an internal server error after "Running 1 test". The test takes about 3 s (7.4 s before).full-pron 7e6a62e (the first version of the warm-up): green. All twelve conformance lanes logged "warm-up: /login settled", in 11–15 s each.@zitadel/conformance; six cold lane runs, all pass (TanStack Start ×2, SolidStart ×2, React, Next.js). In every Vite run the only "optimized dependencies changed. reloading" line comes before the settled line (12–14 s), with no internal server error and nothing after "Running 1 test".full-pron d1e3bf4: green, 87 of 87 tasks. All twelve conformance lanes logged "warm-up: /login settled", in 10–15 s each, so no lane keeps an ordinary request open for the page's life.node scripts/check-pr-title.mjs --title "test: keep the SDK suites and the conformance lane clear of cold-start flakes": ok.waitFortimeout and the 15 s conformance timeout could not be reproduced locally, so the fixes rest on the CI timings and the mechanism above.Release notes / changeset
Notes
vite dev. A fix there would need the dev server to pre-bundle the widget's dependencies at startup, aspackages/sdk-nuxt/src/module.tsdoes for Nuxt. That means an SDK Vite plugin or a CLI change, since the CLI leavesvite.configalone./.vitest/…/deps/paths. They don't fail anything.https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
Generated by Claude Code