Repository navigation
test(CircularProgress): hold motion before tracing its rendering window - #12118
Conversation
Re-cut of #11871, byte for byte, on current main. Co-authored-by: astracat-bot[bot] <323722387+astracat-bot[bot]@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| 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
|
/approve-spec 937be92 |
There was a problem hiding this comment.
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 unchangedto - from >= 1000check 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
movingas 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.
| 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)); |
There was a problem hiding this comment.
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));There was a problem hiding this comment.
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 sinceci:run-a11ywas 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 unchangedto - from >= 1000check 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-a11yis 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
movingas 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.
There was a problem hiding this comment.
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 unchangedto - from >= 1000check 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
movingas 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.
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; ranpnpm 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
movingafter the value-change animations have finished: expectedtrue, receivedfalse. The latest rescued failure was run 1794738898, joba11y 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-sufficiencyINV6; 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
movingin 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.movingin 3/3 runs. Neither mutation is included in the patch.pnpm specs:for --diff origin/mainandpnpm review:preran; the pre-review report has no findings.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.