Repository navigation
fix: wait for the tab strip's failure report in the returning comparison test - #5352
Merged
Merged
Conversation
…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
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.
test_a_comparison_mark_that_failed_on_return_keeps_following_the_comparisonread the page's errors as soon as#transport .lf-settled-diffdisappeared. 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, andconsume_browser_errorsmakes 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
ciruns shows this one macOS failure and passes elsewhere. The race didn't reproduce on Linux, even when the page was slowed with--cpu-throttle6, 10 and 20. So by the rule for macOS-only failures, the next scheduledtest-macosrun is the after evidence. The fixed test passes locally, includingleaf-dev flake --cpu-throttle 6with 18 of 18 copies passing.Closes #5135 — automated triage