From 0d2403ba6b1f9b8c54e21394a7dabd5b284723bd Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Fri, 2 Oct 2026 17:26:50 -0700 Subject: [PATCH] [backport cloud/1.55] test(website): drop whole-route JS ceiling from models catalogue budget Backport of #19669 to `cloud/1.55`. The whole-route ceiling on this release line is flaky by construction, not merely ratcheted. On one fixed build of cloud/1.55 (a9968daf95) the assertion reports two discrete values and the ceiling sits between them: | mode | scripts | total | vs 1,815,000 | |---|---|---|---| | low | 85 | 1,803,417 | passes | | high | 93 | 1,835,228 | fails | Ten consecutive focused runs on that single build: 5 failed, 5 passed. The 31,811-byte swing is eight homepage/brand chunks and no catalogue code: ProductShowcaseSection (10,626), GalleryDetailModal (9,623), AIModelsSection (4,412), ModelCreationsSection (3,836), BrandButton (1,177), brandButton.variants (1,039), CardArrow (1,004), cta (94). They race the `shared` baseline captured on `/`: when they have not arrived by the time the baseline is sampled they are missing from `shared`, then charged in full against `/models/`. That is why the gate passed on #19670 (152/152, 2026-09-30) and failed 3/3 on #19953 (1,835,341, 2026-10-02) with no catalogue change between them. The ceiling had also been ratcheted by unrelated billing work, as #19669 describes upstream: #17971 set 1,810,000, and the #19120 billing backport (#19207) raised it to 1,815,000 on this line. The catalogue-only delta budget is kept and still binds: it measures 507,500 to 526,375 against its 900,000 ceiling, and tightening it to 500,000 fails at 507,500, so it is not vacuous. The regression this test was written for, server catalogue data in the client bundle (#17604), is caught at build time by apps/website/src/integrations/workshop-client-boundary.ts, which is present on this branch. After this change the file's two tests pass 10/10 on the same build. This leaves the resulting test body identical to `main`'s. --- apps/website/e2e/models-performance.spec.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/apps/website/e2e/models-performance.spec.ts b/apps/website/e2e/models-performance.spec.ts index 5c7f1681f71..6dcaeaa5a41 100644 --- a/apps/website/e2e/models-performance.spec.ts +++ b/apps/website/e2e/models-performance.spec.ts @@ -43,17 +43,11 @@ test('catalogue browsing stays within its JavaScript budget', async ({ .getByTestId('workshop-model-card') .first() ).toContainText('Kling') - const scripts = await requestedScripts(page) - const catalogueBytes = scripts + const catalogueBytes = (await requestedScripts(page)) .filter(([name]) => !shared.has(name)) .reduce((total, [, bytes]) => total + bytes, 0) expect(catalogueBytes).toBeGreaterThan(0) expect(catalogueBytes).toBeLessThan(900_000) - // The whole-route ceiling stays as well: catalogue code that migrated into - // a chunk the homepage also loads would pass the delta and still be paid - // for by every visitor to /models/. - const totalBytes = scripts.reduce((total, [, bytes]) => total + bytes, 0) - expect(totalBytes).toBeLessThan(1_815_000) }) test('video cards load on screen and stop playing when scrolled away', async ({