Skip to content

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

Merged
cixzhang merged 1 commit into
mainfrom
recut/11871-circularprogress-hold-motion
Nov 17, 2026
Merged

cixzhang merged 1 commit into
mainfrom
recut/11871-circularprogress-hold-motion

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Re-cut of #11871 by astracat-bot, byte for byte, on current main: the commit's diff is identical to #11871's. Credit stays with astracat-bot (a Co-authored-by trailer on the commit). The drain reviewed #11871 as merge-worthy; #11871 closes when this merges.

Locally: not re-run (a Chromium accessibility spec); the change is #11871's. CI runs no accessibility suite on a Lab-only change unless it carries ci:run-a11y (AST-030 FR26); this pull request carries that label, so its next CI run executes the changed spec.


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.


Overlap checked: #11871 (this is #11871's change, re-cut byte for byte on current main, which supersedes it)

Owning session: noopbot (a61f66c2), under CI & Release (ca77f950). Land path: the shipper, through merge-guard.

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

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

vercel Bot commented Nov 16, 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 16, 2026 5:37pm UTC

Request Review

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

astracat-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

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

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 937be92

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
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-rtl for RTL.


Generated by PR Enrichment workflow | View full report

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 937be92

@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.

Approved pending CI: CI has not run the browser specs on this head yet. All four CI runs on this head, including the three that started when the pull request returned from draft, found CI full and stopped before those jobs started, so the CI jobs need another re-run.

The hold names the leading cap's transform, the judged second runs on the page's own timers, and the description's evidence reproduced in Chromium on this head: 20 of 20 repeats, 20 of 20 with a 2200 ms test-process delay that fails the old test 5 of 5, and both mutations caught.

  • Non-blocking: the judged window is one in-page setTimeout(resolve, 1000), so the unchanged to - from >= 1000 check at line 470 has no slack; waiting a little longer on the page, for example 1010 ms, keeps that check from becoming a new flake (see the comment on line 458).
Claims and files checked

Review mode: same-head; reason: none

Claims:

  • A byte-for-byte re-cut of #11871 on current main with the original author credited: verified; the two diffs are byte-identical and the commit carries a Co-authored-by trailer.
  • #11871 closes when this merges: overtaken; #11871 is already closed unmerged in favor of this pull request.
  • Not re-run locally for the re-cut, with CI to run it: true; CI has not run the changed test on this head yet.
  • 20 of 20 repeats of the changed test with four workers and 10 of 10 for the whole spec: verified; both reproduced on this head.
  • The test intermittently reads moving as false after the change's animations: consistent with the old test, whose final read came after test-process waits; the earlier failing runs themselves were not checked.
  • The 3 s animation ran on while the test process waited between page calls: verified; the old test waited 200 ms and 1000 ms in the test process between evaluations.
  • No behavior change, with the four assertions and the 3000 ms duration unchanged: verified at lines 427 and 470-473; one new assertion checks that the hold took four animations (line 440).
  • The hold names the leading cap's transform, so unrelated animations cannot satisfy the judged-motion check: verified; the last direct span of the fill is the cap that the change rotates.
  • The hold is armed before the update, tracing runs while it holds, the animations resume at 200 ms, one page evaluation takes both marks and the read, and the held set is released after tracing: verified at lines 429-466.
  • Only the existing test changes, with no component, story, timeout, assertion bound or baseline change: verified; one test in one file changes.
  • A 2200 ms test-process delay fails the old test 5 of 5 and the new test passes 20 of 20: verified; reproduced exactly.
  • An animated width fails the zero-Layout check with 61 Layout events, and pausing fails moving: verified; 3 of 3 each.
  • The test and component are unchanged between the earlier failing commit and the stated main base: verified; they are also unchanged up to this pull request's base, which is a later commit, and current main.
  • Formatting and ESLint pass: verified on the changed file; the Lint workflow also passed on this head.
  • The repository's spec lookup and pre-review report ran with no findings: not re-run here.
  • A CI-lab reproduction could not be started, and the failure was rescued five times in seven days: the author's statements, not checkable here.
  • A longer animation or dropping the running-state assertion was rejected: consistent; the patch keeps both.
  • The ownership and land-path notes: process statements, not checkable against the code.
  • Scope is only the CircularProgress browser motion test, with no public API, product or policy change: verified.

Files:

  • packages/lab/src/CircularProgress/__tests__/CircularProgressMotion.a11y.chromium.spec.ts: the non-blocking note above (lines 458 and 470); otherwise clear.

Automated review (maintainer link)

const start = performance.timeOrigin + performance.now();
// Keep both marks and the running-state read in the page's task queue.
// A delayed response to the test cannot move the read past the end.
await new Promise(resolve => setTimeout(resolve, 1000));

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.

Non-blocking: this timer is now the whole window, so expect(to - from).toBeGreaterThanOrEqual(1000) at line 470 has no slack. Chromium coarsens performance.now() to 100 µs on this page, and the same pattern read 999.9 ms in 5 of 1,680 samples on a plain local page. Waiting a little past the bound keeps that check from becoming a new flake, and the window still ends near 1.25 s into the 3 s change:

await new Promise(resolve => setTimeout(resolve, 1010));

@cixzhang
cixzhang marked this pull request as ready for review November 17, 2026 08:57
@cixzhang
cixzhang marked this pull request as draft November 17, 2026 09:16
@cixzhang
cixzhang marked this pull request as ready for review November 17, 2026 09:16
@cixzhang
cixzhang marked this pull request as draft November 17, 2026 09:37
@cixzhang
cixzhang marked this pull request as ready for review November 17, 2026 09:37
@cixzhang
cixzhang marked this pull request as draft November 17, 2026 09:58
@cixzhang
cixzhang marked this pull request as ready for review November 17, 2026 09:58
@cixzhang
cixzhang marked this pull request as draft November 17, 2026 10:21
@cixzhang
cixzhang marked this pull request as ready for review November 17, 2026 10:21

@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.

Changes requested: the test change holds up and ci:run-a11y is now on the pull request, but no CI run has picked the label up yet, so the description's CI sentence is still not true.

  • Miss: the description says this pull request's CI runs the changed Chromium accessibility spec, but a label starts no CI run by itself (FR17 in docs/specs/AST-030/spec.md: it takes effect on the next push, a close and reopen, or marking the pull request ready) and no CI run has started on this head since ci:run-a11y was added, so convert the pull request to draft and back (or close and reopen it) to start a run that executes the spec, or correct the sentence.

Adding the label was the right step; it needs that new run to take effect, which also retries the test-node (7/8) failure in the latest run, a CLI theme test that this change does not reach. The hold names the leading cap's transform, the judged second runs on the page's own timers, and the description's local evidence reproduced in Chromium on this head: 20 of 20 repeats, 20 of 20 with a 2200 ms test-process delay that fails the old test 5 of 5, and both mutations caught.

  • Non-blocking: the judged window is one in-page setTimeout(resolve, 1000), so the unchanged to - from >= 1000 check at line 470 has no slack; waiting a little longer on the page, for example 1010 ms, keeps that check from becoming a new flake (see the comment on line 458).
Claims and files checked

Review mode: same-head; reason: none

Claims:

  • A byte-for-byte re-cut of #11871 on current main with the original author credited: verified; the two diffs are byte-identical and the commit carries a Co-authored-by trailer.
  • #11871 closes when this merges: overtaken; #11871 is already closed unmerged in favor of this pull request.
  • Not re-run locally for the re-cut: true.
  • This pull request's CI runs the changed spec: false at this head; ci:run-a11y is applied, but no CI run has started since, and a label takes effect only on the next push, reopen or ready event.
  • 20 of 20 repeats of the changed test with four workers and 10 of 10 for the whole spec: verified; both reproduced on this head.
  • The test intermittently reads moving as false after the change's animations: consistent with the old test, whose final read came after test-process waits; the earlier failing runs themselves were not checked.
  • The 3 s animation ran on while the test process waited between page calls: verified; the old test waited 200 ms and 1000 ms in the test process between evaluations.
  • No behavior change, with the four assertions and the 3000 ms duration unchanged: verified at lines 427 and 470-473; one new assertion checks that the hold took four animations (line 440).
  • The hold names the leading cap's transform, so unrelated animations cannot satisfy the judged-motion check: verified; the last direct span of the fill is the cap that the change rotates.
  • The hold is armed before the update, tracing runs while it holds, the animations resume at 200 ms, one page evaluation takes both marks and the read, and the held set is released after tracing: verified at lines 429-466.
  • Only the existing test changes, with no component, story, timeout, assertion bound or baseline change: verified; one test in one file changes.
  • A 2200 ms test-process delay fails the old test 5 of 5 and the new test passes 20 of 20: verified; reproduced exactly.
  • An animated width fails the zero-Layout check with 61 Layout events, and pausing fails moving: verified; 3 of 3 each.
  • The test and component are unchanged between the earlier failing commit and the stated main base: verified; they are also unchanged up to this pull request's base, which is a later commit, and current main.
  • Formatting and ESLint pass: verified on the changed file; the Lint workflow also passed on this head.
  • The repository's spec lookup and pre-review report ran with no findings: not re-run here.
  • A CI-lab reproduction could not be started, and the failure was rescued five times in seven days: the author's statements, not checkable here.
  • A longer animation or dropping the running-state assertion was rejected: consistent; the patch keeps both.
  • The ownership and land-path notes: process statements, not checkable against the code.
  • Scope is only the CircularProgress browser motion test, with no public API, product or policy change: verified.

Files:

  • packages/lab/src/CircularProgress/__tests__/CircularProgressMotion.a11y.chromium.spec.ts: the non-blocking note above (lines 458 and 470); otherwise clear.

Automated review (maintainer link)

@cixzhang cixzhang added the ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) label Nov 17, 2026

@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.

Approved pending CI: the test change holds up, and no CI run has finished on this head yet.

CI turned the first two runs that carry ci:run-a11y away as full before any accessibility job ran; marking the pull request ready again has started a third, which is waiting for room. Once admitted it runs the changed accessibility spec and retries the earlier run's unrelated test-node (7/8) failure, and merging waits on its required checks; if CI turns it away too, re-running all of its jobs keeps the labelled event.

  • Non-blocking: the judged window is one in-page setTimeout(resolve, 1000), so the unchanged to - from >= 1000 check at line 470 has no slack; waiting a little longer on the page, for example 1010 ms, keeps that check from becoming a new flake (see the comment on line 458).
Claims and files checked

Review mode: same-head; reason: none

  • changed rules (0)

Claims:

  • A byte-for-byte re-cut of #11871 on current main with the original author credited: verified; the two diffs are byte-identical and the commit carries a Co-authored-by trailer.
  • #11871 closes when this merges: overtaken; #11871 is already closed unmerged in favor of this pull request.
  • Not re-run locally for the re-cut: the author's statement.
  • CI runs no accessibility suite on a Lab-only change without ci:run-a11y: verified against FR26 of the CI spec and the accessibility jobs' conditions in the CI workflow.
  • This pull request carries that label: verified; an engineering owner applied it.
  • Its next CI run executes the changed spec: consistent with the CI rules, not yet borne out; marking the pull request ready again started runs whose events carry the label, CI turned the first two away as full before the accessibility jobs ran, and the third was waiting for room when this review ended.
  • 20 of 20 repeats of the changed test with four workers and 10 of 10 for the whole spec: verified; both reproduced on this head.
  • The test intermittently reads moving as false after the change's animations: consistent with the old test, whose final read came after test-process waits; the earlier failing runs themselves were not checked.
  • The 3 s animation ran on while the test process waited between page calls: verified; the old test waited 200 ms and 1000 ms in the test process between evaluations.
  • No behavior change, with the four assertions and the 3000 ms duration unchanged: verified at lines 427 and 470-473; one new assertion checks that the hold took four animations (line 440).
  • The hold names the leading cap's transform, so unrelated animations cannot satisfy the judged-motion check: verified; the fill's last direct span is the cap that the change rotates, and the hold rejects when it took no animation of that motion.
  • The hold is armed before the update, tracing runs while it holds, the animations resume at 200 ms, one page evaluation takes both marks and the read, and the held set is released after tracing: verified at lines 429-466.
  • Only the existing test changes, with no component, story, timeout, assertion bound or baseline change: verified; one test in one file changes.
  • The test and component are unchanged between the earlier failing commit and the stated main base: verified; they are also unchanged up to this pull request's base and current main.
  • A 2200 ms test-process delay fails the old test 5 of 5 and the new test passes 20 of 20: verified; reproduced exactly.
  • An animated width fails the zero-Layout check with 61 Layout events, and pausing fails moving: verified; 3 of 3 each.
  • Formatting and ESLint pass: verified on the changed file; the Lint workflow also passed on this head.
  • The repository's spec lookup and pre-review report ran with no findings: not re-run here.
  • A CI-lab reproduction could not be started, and the failure was rescued five times in seven days: the author's statements, not checkable here.
  • A longer animation or dropping the running-state assertion was rejected: consistent; the patch keeps both.
  • The ownership and land-path notes: process statements, not checkable against the code.
  • Scope is only the CircularProgress browser motion test, with no public API, product or policy change: verified.

Files:

  • packages/lab/src/CircularProgress/__tests__/CircularProgressMotion.a11y.chromium.spec.ts: the non-blocking note above (lines 458 and 470); otherwise clear.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as draft November 17, 2026 11:47
@cixzhang
cixzhang marked this pull request as ready for review November 17, 2026 11:47
@cixzhang
cixzhang marked this pull request as draft November 17, 2026 12:06
@cixzhang
cixzhang marked this pull request as ready for review November 17, 2026 12:06
@cixzhang
cixzhang marked this pull request as draft November 17, 2026 12:26
@cixzhang
cixzhang marked this pull request as ready for review November 17, 2026 12:26
@cixzhang
cixzhang merged commit ce3022d into main Nov 17, 2026
522 of 586 checks passed
@github-actions
github-actions Bot deleted the recut/11871-circularprogress-hold-motion branch November 18, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — 937be923 Deployed Nov 16, 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-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) 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