Repository navigation
test(website): time the models render guard loader from island hydration - #21047
Conversation
The catalogue cases measured the loader from navigation start, so the 1 s grace also covered booting the site's JavaScript on the runner. On CI that boot alone takes most of the budget, and /hub/models/ failed at 1.07 to 1.22 s on main and in the merge queue. Count the grace from the moment the page's island hydrates instead, which is when the component owns the screen.
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measureExecutes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight This candidate changes nothing the matrix measures, so every expensive stage was skipped. Reproduce locally# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
npx vitest run --config vitest.matrix.config.mts
Full docs: scripts/registry-census/README.md 🌾 Fallow: ✅ PassedFallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened. No new findings in the changed files. Reproduce locally# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since 1301f9d3de77b61cd33489bffba052c006594193
Full docs: ADR-DEVEX-LINT-0015 🌐 Website E2ETip All tests passed.
🔗 Website PreviewWebsite Preview: https://comfy-website-preview-pr-21047.vercel.app Models is built and gated by PostHog (workshop-enabled), using staging Cloud. This commit: https://website-frontend-ir2o942um-comfyui.vercel.app Last updated: 2026-10-14T23:55:25Z for |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #21047 +/- ##
==========================================
- Coverage 86.40% 86.29% -0.12%
==========================================
Files 3690 3585 -105
Lines 175494 172259 -3235
Branches 46354 45254 -1100
==========================================
- Hits 151641 148652 -2989
+ Misses 21801 21711 -90
+ Partials 2052 1896 -156
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Ports #21047 from main. The guard timed the /hub/models/ loader from navigation start, so its 1s grace also covered booting the site's JavaScript on the runner and the catalogue cases failed on timing.
Requested by Alexander Brown · Slack thread
Summary
models-render-guard.spec.tstimed the/hub/models/loader from navigation start, so its 1 s grace also had to cover booting the site's JavaScript on the runner. That boot alone takes most of the budget on CI, so the catalogue cases fail on timing, not on the loader lingering. This PR counts the grace from the moment the page's island hydrates. That is when the component takes over the screen, and when the post-mountmodels-loadingloader the guard was written for starts.Before:
loaderLastSeenAtwasperformance.now()at the last frame a loader was visible, compared with 1000 ms. The catalogue rendersWorkshopLoadingon the server (the island is not mounted yet), so that number covers the whole HTML, JS, hydration andcatalogue.jsonchain. When #19394 added the guard, the worst local run was 774 ms, and its review focus already flagged the 1 s budget as the risk. On CI the catalogue cases now land at 1.07 to 1.22 s:None of these come from a change to the catalogue: the same tree passed on rerun. In a local trace about 660 to 940 ms of the 1.0 to 1.3 s went to booting and hydrating the page.
ModelsCatalogueand/models/catalogue.jsonare only requested once the island mounts.After: the init script records when each
<astro-island>hydrates. Astro dispatches a non-bubblingastro:hydrateon it, so the script listens in the capture phase.waitUntilSettledreads that time for the island holding the page content and waits a full grace window after it. The assertion becomes "ms after the page island hydrated that the loader was last visible", still under 1000 ms. The CLS budget, the pages, the flag matrix and the readiness waits are unchanged. A loader the server renders into a model page is still caught by the existing JavaScript-off cases, which assertworkshop-loadingis hidden.Verification
build:e2eof currentmainwith a local Chromium, launched throughexecutablePathfrom a scratch config that is not committed.--repeat-each 5 --workers 2on the catalogue cases: 16 of 20 failed, at 1044 to 1323 ms.--repeat-each 10 --workers 3: 200 of 200 passed. The loader was last visible at most 456 ms after hydration. Under the old metric, 14 of those 40 catalogue runs would have failed, peaking at 1466 ms./models/catalogue.jsonby 1.5 s withcontext.routefailed all four catalogue cases, with the loader last visible about 1.5 s after hydration.🤖 Generated with Claude Code
https://claude.ai/code/session_018GfgJuhjWFFm4LbKojTDxV