Skip to content

test(Tokenizer): capture busy layout before the search settles - #11034

Merged
astracat-bot[bot] merged 1 commit into
mainfrom
codebunny/fix/test-tokenizer-capture-busy-layout-before-the-search-settles-786a44
Nov 10, 2026
Merged

astracat-bot[bot] merged 1 commit into
mainfrom
codebunny/fix/test-tokenizer-capture-busy-layout-before-the-search-settles-786a44

Conversation

@astracat-bot

@astracat-bot astracat-bot Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

validation: ran pnpm storybook:build (passed); pnpm test:a11y-contract --grep 'rtl.*a themed, larger Spinner' --repeat-each=20 --workers=4 TokenizerEndLane.a11y.chromium.spec.ts (20 passed); pnpm test:a11y-contract --fully-parallel --workers=4 TokenizerEndLane.a11y.chromium.spec.ts (22 passed). Prettier, scoped ESLint, specs:for and review:pre passed with no change findings.

Maintainer impact

The themed Tokenizer end-lane contract can fail with “The search settled before 208px was measured” even though its geometry is correct. Its busy-box measurement crosses several browser-driver calls and four animation frames, while the Loading story's search resolves after 1,200 ms. A delayed driver continuation can therefore read the settled field instead of the busy Spinner state the test triggered.

Intended invariant

No behavior change. Keep the exact settled-versus-busy width and height comparison, the 200–400 px and max-content sweep, both directions, and the 24 px Spinner override. The maintained contract is input-fields FR1/FR7: source-busy feedback must not change the field's geometry.

Change

Arm an in-page observer before the search keystroke. Capture the box when aria-busy begins and on every animation frame while it remains true; retain any exact dimension mismatch until the search settles. A driver delay no longer loses that observation. The sampler cannot finish without seeing a busy transition, and its observer/frame callback are released after each measurement. Also wait for the baseline query to enter and leave busy state, rather than mistaking its debounce period for a settled search.

Only the test changes. The search source, queries, product timers, component code, assertions, and timeouts are unchanged. The alternative of making the fixture search slower or retrying missed samples is deliberately avoided.

Evidence

Newest failed try: 2026-11-10 11:27 UTC, run 1794309614, job “a11y contracts 3/8 part 1/2”, commit 42e482c. Earlier failures reported the same race at 264, 248, and 368 px.

deflake_evidence: d. It was rescued 5 times in 7 days across 5 commits and 2 containers (causes async-retry 2, retry 2, other 1).

  • Before: pnpm test:a11y-contract --grep 'a themed, larger Spinner' --repeat-each=20 --workers=4 TokenizerEndLane.a11y.chromium.spec.ts passed 40/40 at 42e482c, consistent with intermittency.
  • Failure injection: temporarily delay the driver continuation by 1,300 ms after the busy state starts. The original sampler failed 2/2 RTL runs with “The search settled before 200px was measured”. No input event or product timer changed.
  • With the fix: the same delayed-read injection passed 2/2 RTL runs across the complete width sweep. The delay is not part of the patch.
  • Final validation at 43fa8be: 20/20 repeated RTL runs passed with four workers; the complete file passed 22/22 with four workers, including LTR and the unthemed geometry sweep. The test file is unchanged on the latest main fetched before submission.
  • Mutation sensitivity: temporarily force a 200 px minimum height only while aria-busy is true. The unchanged exact-size assertion fails, reporting all 27 width cases, including 200px: settled 200x136, busy 200x200 and max-content: settled 629.22x32, busy 629.22x200. The injected style is not part of the patch.

Scope

Components: Tokenizer browser test only.

No intended public API, product behavior, visual direction, or policy change. No product files, baselines, retry settings, or timeout budgets change.

@vercel

vercel Bot commented Nov 10, 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 10, 2026 12:32pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 10, 2026
@astracat-bot

astracat-bot Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor Author

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 10, 2026, 12:56 PM UTC

@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · e77a5eb

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
Tokenizer · Storybook 93.4 kB (0) · 18.8 kB CSS (0) 2,340 (0) ✓ · ✓ · ✓

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

API changes: none in this pull request

Committed API report behind this build: cli 36 rows, core 36 rows; run pnpm api:report.

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

@astracat-bot
astracat-bot Bot merged commit f881bae into main Nov 10, 2026
67 checks passed
@meta meta deleted a comment from astracat-bot Bot Nov 10, 2026
@github-actions
github-actions Bot deleted the codebunny/fix/test-tokenizer-capture-busy-layout-before-the-search-settles-786a44 branch November 11, 2026 06:05

This branch was successfully deployed

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

Labels

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.

0 participants