Skip to content

test: wait for the plain-page motion study to stop before reading its last frame - #6194

Merged
leaf-agent merged 1 commit into
mainfrom
fix/motion-plain-page-end-race
Nov 16, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/motion-plain-page-end-race

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

test_a_display_widget_draws_on_a_page_without_leaf failed on #6184's CI (run 43915527596) with assert 299.5 == 300. #6184 didn't cause it: it changed only a CSS comment and a journey's expected widths. The cause is in the test. lf-motion's clock shows Math.round(time), so it already reads "300 ms" when the clock stands at 299.5 ms, one frame before playback ends. The test waited on that text and then read the last drawn frame. It now waits for the transport's button to say Play again, which #tick does when it pauses at the duration, in the same task that draws the final frame. The assertions themselves are unchanged, and so is the widget.

Verified locally: the test passes alone, and five more times with six busy loops starving the 4-core runner of CPU. The failure needs a frame to land within half a millisecond of the end, so it didn't reproduce before the change either; the evidence for the cause is the CI failure together with the rounding in packages/motion/widgets/motion-view.js.

… last frame

The clock shows Math.round(time), so it reads "300 ms" at 299.5 ms, a frame
before playback reaches the end. The test then read drawnAt.at(-1) as 299.5 on
PR #6184's CI run 43915527596. It now waits for the transport to say Play
again, which happens in the same tick that draws the final frame at the
duration. No behavior changes.
@leaf-agent
leaf-agent merged commit b559009 into main Nov 16, 2026
6 checks passed
@leaf-agent
leaf-agent deleted the fix/motion-plain-page-end-race branch November 16, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant