Repository navigation
fix(verify): wait for dev servers to compile before running browser specs - #263
Merged
Merged
Conversation
…pecs The svelte-dev layer failed its first spec on run 37880143781 while the other six passed: the first navigation to /login timed out after 10s. A Vite dev server answers / and /health before it has compiled anything, so the first page load paid for the cold transform of the whole client graph (about 90 modules for SvelteKit, whose client runtime is served as source). Reproduced locally with the container held to 0.1 CPU. - vue-app and svelte-app warm their client modules at startup through server.warmup.clientFiles. - The vue-dev and svelte-dev healthchecks wait for a compiled module and then the prebundled SDK, as angular-dev waits for its compiled bundle. - seamless verify now brings each browser service up with --wait. Before, nothing waited on the compose healthchecks; the harness only probed /health. A service that never gets healthy fails its own layer, with its logs, and the run continues. - The nginx services' healthchecks probe 127.0.0.1. busybox wget resolves localhost to ::1 and nginx listens on IPv4 only, so they never passed, which went unnoticed while nothing waited on them.
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.
Why
The
svelte-devlayer failed on run 37880143781 (PR #261, attempt 1): only the first spec,react/emailOtpLogin.spec.ts, timed out after 10s waiting for the/loginheading (verify/harness/lib/reactFlows.ts:57). The other six passed, and attempt 2 passed all 13 layers. #261 touches nothing underverify/, so this is a startup race, not a regression.A Vite dev server answers
/and/healthbefore it has compiled anything, so the first navigation paid for the cold transform of the whole client graph. For SvelteKit that is about 90 modules, because its client runtime under@sveltejs/kit/src/runtimeis served as source, not prebundled. No dependency is discovered late: the container logs show the scanner finding every import (@seamless-auth/svelteincluded) and no re-optimization or reload, sooptimizeDeps.includewould not change anything.A second issue made the compose healthchecks irrelevant:
seamless verifystarted each browser service withup -dand never waited on them. The only gate was the harness's/healthprobe. That is also why the production nginx healthchecks could fail on every run without anyone noticing.What
verify/vue-appandverify/svelte-appwarm their client modules at startup (server.warmup.clientFiles). SvelteKit's kit client entry is named explicitly, because warmup globs skipnode_modules.vue-devandsvelte-devhealthchecks wait for a compiled module and then the prebundled SDK, in order, the wayangular-devwaits for/main.js. Fetching the entry first avoids a misleading "file does not exist" error that Vite 7 logs when a prebundled file is requested before the dependency scan has registered it.seamless verifynow runsup -d --waitfor each browser pass after the build. A service that never becomes healthy fails only its own layer and dumps its recent logs. The run continues (new unit test).react,angular,vue, andsveltenginx healthchecks probe127.0.0.1. busyboxwgetresolveslocalhostto::1, and nginx listens on IPv4 only, so these had never passed.--waitwould otherwise fail every production layer.Verification
All runs below start from fresh containers, after a
--no-cacheimage build.None of the container logs from these runs contains a dependency re-optimization, a reload, or a missing-file error after the first page load. The startup cost now lands before the healthcheck passes, which
--waitabsorbs.A full
seamless verify --devagainst seamless-templates main passed 13 of 13 layers.npm run buildandnpm run coveragepass (1246 tests).