Skip to content

test(CircularProgress): hold motion before tracing its rendering window - #11871

Closed
astracat-bot[bot] wants to merge 1 commit into
mainfrom
codebunny/fix/test-circularprogress-hold-motion-before-tracing-its-rendering-window-f0ceaf
Closed

astracat-bot[bot] wants to merge 1 commit into
mainfrom
codebunny/fix/test-circularprogress-hold-motion-before-tracing-its-rendering-window-f0ceaf

Conversation

@astracat-bot

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

Copy link
Copy Markdown
Contributor

validation: ran pnpm test:a11y-contract --grep 'a value change lays out and paints nothing per frame' --repeat-each=20 --workers=4 --output=test-results/motion-repeat CircularProgressMotion.a11y.chromium.spec.ts, 20/20 passed; ran pnpm test:a11y-contract --workers=1 --output=test-results/motion-full CircularProgressMotion.a11y.chromium.spec.ts, 10/10 passed.

Maintainer impact

The rendering contract intermittently reads moving after the value-change animations have finished: expected true, received false. The latest rescued failure was run 1794738898, job a11y contracts 4/8 part 1/2, at db3f616. This produces a false failure even when the fill animates without per-frame layout or paint.

The test leaves its three-second animation running while it awaits Storybook and separate test-process waits and browser calls. Those delays can consume the animation before the last running-state read.

Intended invariant

No behavior change. A full second of the actual value-change animation must remain running and produce zero Layout and zero Paint events. All four existing assertions and the 3000 ms duration remain unchanged. The hold names the leading cap's transform, consistent with architecture:component-test-sufficiency INV6; unrelated animations cannot satisfy that judged-motion check.

Change

Arm the existing scoped animation hold before updating the story. Start tracing while the change is held, then resume the captured fill animations at 200 ms. Keep the start time, one-second wait, end time, and running-state observation in one browser evaluation. Slow responses to the test process cannot move that observation past the animation's end. Release the held set after tracing.

Only the existing test changes. No component, story, timeout, assertion bound, or baseline changes.

Evidence

  • Unchanged code: 20/20 local repeats passed with four workers. The test and component are unchanged between the rescued commit and the current main base, da710f6.
  • Observation-race proof: temporarily delay the test process by 2200 ms immediately after the value update. The old test fails moving in 5/5 runs with the reported Expected/Received values. The fix passes 20/20 repeats with the same injected delay and four workers. The delay is not included in the patch.
  • Mutation sensitivity: replace one captured animation's keyframes with an animated width. The fixed test fails the zero-Layout assertion in 3/3 runs, recording 61 Layout events each time. Pausing the captured animations during the judged window fails moving in 3/3 runs. Neither mutation is included in the patch.
  • Final unchanged-motion coverage: the full spec passes all 10 checks, including busy-main-thread motion, ring parity, half-ring crossings, reduced motion, theme timing, and the storyboard.
  • Formatting and ESLint pass. pnpm specs:for --diff origin/main and pnpm review:pre ran; the pre-review report has no findings.
  • A CI-lab reproduction was requested twice at the rescued commit, but the service could not start it and returned no reproduction ID or run counts. The spontaneous intermittent failure did not occur locally; the causal proof above uses an injected observation delay rather than claiming a natural reproduction.

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

Rescued runs and commits (each passed after its in-job rescue):

Scope

Components: CircularProgress browser motion test only.

Fixes test 75e200fe68c48aa09e2803f0f19b558fd3e41702ced82c26381392cedc71f798: packages/lab/src/CircularProgress/__tests__/CircularProgressMotion.a11y.chromium.spec.ts › a value change lays out and paints nothing per frame.

No intended public API, product behavior, visual direction, or policy change. Increasing the animation duration or dropping the running-state assertion was rejected: either would avoid, rather than fix, the observation race.

@vercel

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

Request Review

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

astracat-bot Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor Author

AI review status for this pull request.

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

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not finished on this head yet.

Arming the harness hold before the value change, then restarting the four fill animations at 200 ms and taking both marks and the running-state read in one page evaluation, removes the test-process round trips from the judged second. With a 2.2 s delay injected after the value update, the old test fails the running-state check in every run while the new one passes, and the whole spec file passes. Nothing else is needed from you.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim: the test sometimes reads the change as stopped after it has finished. Consistent: the old test fails exactly this way under an injected delay; the CI records themselves were not read.
  • Claim: test-process waits and round trips during the 3 s change cause it. Verified: the old test spends a re-render wait, two timed waits and two evaluations inside the change, and a 2.2 s delay makes it fail.
  • Claim: no behavior change; the four existing assertions and the 3000 ms duration stay. Verified in the test, lines 427 and 470-473.
  • Claim: the hold names the leading cap's transform, so unrelated animations cannot satisfy it. Verified: the judged target is the turning cap layer, and the harness rejects a hold without it.
  • Claim: arm the hold first, trace while held, restart at 200 ms, keep the marks, the wait and the read in one evaluation, release after. Verified, lines 431-466.
  • Claim: only the existing test changes. Verified: one file.
  • Claim: the test and component are unchanged between the rescued commits and the base. Verified: neither file differs at any of the five.
  • Claim: with a 2.2 s delay the old test fails the running-state check 5 of 5 and the fix passes. Verified: reproduced, 5 of 5 failed and 10 of 10 passed.
  • Claim: a width mutation fails the zero-layout check and pausing fails the running-state check. Verified by reading the assertions; not re-run.
  • Claim: 20 of 20 repeats with four workers and 10 of 10 for the whole spec pass. Verified: both reproduced.
  • Claim: formatting and lint pass. Verified on the file.
  • Claim: the spec lookup and the pre-review report found nothing. The file's spec lookup was re-run; the pre-review report was not.
  • Claim: a remote reproduction could not be started, and the test was rescued five times across five commits. The five commits exist; the run records were not read.
  • Claim: a longer duration or dropping the running-state check was rejected. Consistent: neither is in the diff.
  • File: packages/lab/src/CircularProgress/__tests__/CircularProgressMotion.a11y.chromium.spec.ts: clear.

Automated review (maintainer link)

@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · f8287fd

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC
lab/CircularProgress · Storybook 9.1 kB (0) · 880 B CSS (0) 574 (0)

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

Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.

Current run: CI concluded failure; parts of this report may be missing.


Generated by PR Enrichment workflow | View full report

@cixzhang

Copy link
Copy Markdown
Contributor

(Posted by Cindy's agent.) Closing in favor of #12118, a byte-identical copy of this change that keeps your credit as co-author. That copy goes through the normal merge path.

@cixzhang cixzhang closed this Nov 16, 2026
@github-actions
github-actions Bot deleted the codebunny/fix/test-circularprogress-hold-motion-before-tracing-its-rendering-window-f0ceaf branch November 17, 2026 06:03
cixzhang added a commit that referenced this pull request Nov 17, 2026
…ow (#12118)

test(CircularProgress): hold motion before tracing its rendering window

Re-cut of #11871, byte for byte, on current main.

Co-authored-by: astracat-bot[bot] <323722387+astracat-bot[bot]@users.noreply.github.com>

This branch was successfully deployed

1 active deployment
Preview — f8287fd8 Deployed Nov 15, 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.

1 participant