Repository navigation
test: wait for lf-motion's failure reports before consuming them - #5351
Merged
Merged
Conversation
A widget failure's console report lands a task after the widget draws it (`lfDocumentLifetime.whenActive` defers it with setTimeout), so the motion failure test could see "Failed" on the clock and then read an empty problem list. It now waits for the complete inventory with `reported_browser_errors`: one playback failure, and one frame failure for each of the three draws that threw (End, ArrowLeft, Play). The behavior protected is unchanged. Closes #5138
This was referenced Nov 4, 2026
max-sixty
pushed a commit
that referenced
this pull request
Nov 9, 2026
…ors reads it (#5781) `consume_browser_errors` read `page.lf_errors` the moment it was called. A widget's failure box and its console report reach Python by separate paths, so a test that waited for the box and then consumed the problem could find an empty list. That is what failed `test_visual_review_guides_one_typed_still_run` on macOS in scheduled run [42604289041](https://github.com/max-sixty/leaf/actions/runs/42604289041): the page showed `before is 1800px wide and after is 780px` in `.lf-error`, then `consume_browser_errors` asserted on `[]`. #5351 and #5352 fixed this same race one test at a time. Now the helper itself keeps the Playwright driver pumping until the first problem arrives, using the same wait `reported_browser_errors` already had (moved into `_await_browser_errors`). A closed page stops the wait. What counts as a match is unchanged. The race only shows on macOS, so the failing run above is the before evidence. On Linux, the visual-review journey, `tests/model/test_chrome_contracts.py`, the closed-page consumer in `test_status_and_news.py` and `tests/smoke/test_plain_page.py` pass with the change. The next scheduled `test-macos` run shows whether it holds there. #5780's other nine macOS failures have different causes and stay open there. Refs #5780 — automated triage Co-authored-by: leaf-agent <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The motion failure test read its browser problems a task too early. A widget failure's console report is deferred by
lfDocumentLifetime.whenActive(browser/runtime/prepaint.js), which reports in asetTimeoutafter the widget has already drawn "Failed" on its clock, soconsume_browser_errorscould run between the paint and the report and find an empty list, as the macOS job did in run 41432142330. The test now waits for the complete inventory withreported_browser_errors: one playback failure, then one frame failure for each of the three draws that threw (End, ArrowLeft, Play). Widening the report's deferral by 300 ms in the page reproduces the CI assertion (assert ([])) on the old test and passes on the new one; without the injected delay the test passes repeatedly, including at--cpu-throttle 12.The same deferral also let the frame-failure check consume early, which left a late third report for the fixture's teardown under the widened delay; the exact inventory closes that too. No product code changes, and the behavior the test protects (the clock says Failed, the box stays single, the agent hears each failure) is unchanged.
Closes #5138 — automated triage