Skip to content

fix: wait for the tab strip's failure report in the returning comparison test - #5352

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-5135
Nov 4, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-5135

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

test_a_comparison_mark_that_failed_on_return_keeps_following_the_comparison read the page's errors as soon as #transport .lf-settled-diff disappeared. That wait doesn't cover the tab strip's failure report. In a probe of the page, the settled mark disappeared about 12 ms after the tabs returned, and <lf-tabs id="views"> reported its deliberate failure about 6 ms after that. Playwright's sync driver also hands console messages to Python only while a later Playwright call runs, and consume_browser_errors makes no such call. On macOS in scheduled run 41432142330, the test read an empty list. That run's failure screenshot shows the page had drawn <lf-tabs> failed: the marks failed once, so the page behaved correctly and the test read the list too early.

The test now uses reported_browser_errors, the harness helper for this case. It waits for exactly one report, leaf: <lf-tabs id="views"> failed: the marks failed once. The assertion keeps what the test protects: one report that names the tab strip and the thrown message. Any extra problem still fails through the browser fixture. No product code changes.

Verification: the test's record in the last 12 scheduled ci runs shows this one macOS failure and passes elsewhere. The race didn't reproduce on Linux, even when the page was slowed with --cpu-throttle 6, 10 and 20. So by the rule for macOS-only failures, the next scheduled test-macos run is the after evidence. The fixed test passes locally, including leaf-dev flake --cpu-throttle 6 with 18 of 18 copies passing.

Closes #5135 — automated triage

…son test

`test_a_comparison_mark_that_failed_on_return_keeps_following_the_comparison`
read the page's errors as soon as the settled mark disappeared. In the browser
the mark goes about 12 ms after the tabs return and the tab strip's failure
report about 6 ms later, and Playwright's sync driver delivers console messages
only during a later call. So the read could find no error yet, as it did on
macOS in scheduled run 41432142330, whose screenshot shows the reported
failure box. The test now waits for exactly that report with
`reported_browser_errors`. It still asserts one report naming the tab strip and
the thrown message, and any other problem still fails through the browser
fixture.

Closes #5135
@leaf-agent
leaf-agent merged commit 649db78 into main Nov 4, 2026
5 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-5135 branch November 4, 2026 10:29
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]>
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.

Returning failed comparison mark produces no expected report

1 participant