Skip to content

test(AspectRatio): the fit-layer spec answers the story's remote photos locally - #9703

Merged
cixzhang merged 1 commit into
meta:mainfrom
vjeux:test/aspectratio-fit-layers-local-photos
Nov 3, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
vjeux:test/aspectratio-fit-layers-local-photos

Conversation

@vjeux

@vjeux vjeux commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer impact

The release check fails in AspectRatioFitLayers.a11y.browser.spec.ts whenever picsum.photos answers slowly: each case waits out the 60 s test timeout in page.setContent. Nothing is wrong with AspectRatio. The FitModes story loads its photos from picsum.photos; the spec opens the story, then calls page.setContent, which waits for the load event, and Chromium does not fire it while those photo requests are in flight.

Intended invariant

The spec's claims are unchanged: it still captures the FitModes story's real markup and compiled CSS and proves fit fills the box on each documented setup. Only its inputs become local.

Change

Before it opens the story, the spec routes **://picsum.photos/** to a local SVG, so no request leaves the machine. The Lightbox specs already route picsum.photos for their own stories (they abort the requests). No timeout changes.

Evidence

  • Failure before the change: with picsum.photos held open, main's spec fails 6 of 6, each with "page.setContent: Test timeout of 60000ms exceeded". On a machine whose network reaches picsum slowly, main's spec failed 3 of 6 the same way with no seam.

  • Success after the change: with picsum.photos held open, this spec passes 6 of 6 in 6.3 s (Testing).

  • Product/runtime behavior verified unchanged: test-only; no product file changes.

  • CI impact: none.

  • Other specs that load remote URLs: a census loaded all 2,599 stories in a fresh build and recorded each request that would leave the machine (local probe, not part of the diff). 103 stories make such requests (picsum.photos, i.pravatar.cc, cdn.jsdelivr.net, images.unsplash.com and others). Four browser specs open one of those stories: this one, the two Lightbox specs (which abort the picsum requests) and CardPress.a11y.chromium.spec.ts (which answers every outside request locally). No other browser spec opens one.

Scope

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

Red-first at 3ba0528234 (this head, one commit on main e0eac233d8), against a fresh Storybook build of that main, with a local seam (a route that never answers picsum.photos; local probe, not part of the diff):

  • main's spec: 6 of 6 fail, "page.setContent: Test timeout of 60000ms exceeded";
  • this spec: 6 of 6 pass in 6.3 s;
  • main's spec without the seam, on a network that reaches picsum slowly: 3 of 6 fail the same way.

Local gates at 3ba0528234:

  • The spec ×10 in Chromium (playwright test --config playwright.config.ts --project=chromium, the test:a11y-contract command): 60 of 60 pass. WebKit under the CI WebKit job's command: 6 of 6.
  • Typecheck, eslint and the strict comment lint on the changed file, Prettier, pnpm check:repo, pnpm check:changesets and pnpm specs:for --diff origin/main (no routed claims). pnpm build passes. pnpm test:ui and pnpm test:node with --changed=origin/main find no affected unit test.

…os locally

The FitModes story loads its photos from picsum.photos. The spec opens the
story, then calls page.setContent, which waits for the load event, and
Chromium does not fire it while those photo requests are in flight. When
picsum answered slowly, each case waited out the 60 s test timeout. The
spec now routes picsum.photos to a local SVG before it opens the story, so
it never waits on the network. No timeout changes.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 3, 2026
@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 3, 2026 4:46am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 3, 2026, 4:50 AM UTC

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 3ba0528

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
AspectRatio · Storybook 3.8 kB (0) · 3.6 kB CSS (0) 109 (0) ✓ · ✓ · —

Package size: no published package changed; no new dependencies.

Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.


Generated by PR Enrichment workflow | View full report

@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 3, 2026
@cixzhang
cixzhang marked this pull request as ready for review November 3, 2026 04:40

@astracat-bot astracat-bot Bot 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.

This looks ready to approve, with no blocking findings.

The spec now answers the FitModes story's picsum.photos requests with a local SVG before it opens the story, so a slow photo host can no longer hold the load event that page.setContent waits for. With picsum.photos held open, the current spec times out in page.setContent on every case, while this version passes all six. The captured markup, CSS and assertions are unchanged, so the spec still proves what it did.

[Automated review]

@cixzhang
cixzhang merged commit 3e09348 into meta:main Nov 3, 2026
106 checks passed
@vjeux
vjeux deleted the test/aspectratio-fit-layers-local-photos branch November 3, 2026 05:14

This branch was successfully deployed

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

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants