Skip to content

Wait for Leaf's deferred fault reports before tests read browser errors - #5312

Merged
max-sixty merged 1 commit into
mainfrom
fix/issue-5189
Nov 4, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix/issue-5189

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

test_widget_controller_owns_presentation_across_values_and_lifetimes intermittently read no browser errors on the scheduled macOS job (run 41432142330 for light and shadow-child, run 41622727492 for shadow-host), where it expected the deliberate render failure's leaf: report. Since #4966, reportPageError writes that report through lfDocumentLifetime.whenActive, a task after the fault, so a removed iframe's cancelled requests don't read as page failures. The error box and a settled presentation therefore no longer mean the console has the report, and a test that reads take_browser_errors right away races it.

Five browser tests read a leaf: report this way. They now call reported_browser_errors, the harness's existing wait for a named inventory of browser problems, which still requires exactly the reports each test expects (one each, two for the returning widget). The returning-widget test's ad hoc expect_console_message wrappers from #5108, which fixed the same race there, are replaced by the same call. No product behavior changes.

Verification: with every leaf: console report held 300 ms in layer-client.js (a local experiment, not committed), five of the seven focused cases fail on the old tests with the reported [] == [...] diagnostic, and all seven pass on the new tests, with and without the delay:

tests/browser/test_render_application_boundary.py::test_a_returning_widget_repaints_to_restore_subscriptions
tests/browser/test_render_application_boundary.py::test_widget_controller_owns_presentation_across_values_and_lifetimes  (3 cases)
tests/browser/test_render_application_boundary.py::test_thread_presentation_waits_for_its_frozen_widgets_only
tests/browser/navigation/test_obligation_walk.py::test_a_failed_obligation_reveal_does_not_register_an_arrival
tests/browser/test_render_outbox.py::test_an_optimistic_presentation_fault_does_not_change_delivery_result

Closes #5189 — automated triage

…rors in tests

Since #4966, `reportPageError` writes its `leaf:` console report through
`lfDocumentLifetime.whenActive`, in a task after the fault, so a removed
iframe's cancelled requests don't read as page failures. A widget's error box
and a settled presentation therefore no longer imply the console has the
report. Five browser tests still read `take_browser_errors` right after the
fault and compared it for equality, so on a slower runner (the scheduled
macOS job) they read an empty list.

They now call `reported_browser_errors`, the harness's existing wait for a
named inventory of browser problems, which still requires exactly the one
(or, for the returning widget, two) reports each test expects. The returning
widget test's ad hoc `expect_console_message` wrappers from #5108 go too.
No product behavior changes.

Holding every `leaf:` console report 300 ms makes five of the seven focused
cases fail on the old tests with the reported `[] == [...]` diagnostic; all
seven pass on the new tests, with and without the delay.

Closes #5189
@max-sixty
max-sixty merged commit 410b6e3 into main Nov 4, 2026
5 of 7 checks passed
@max-sixty
max-sixty deleted the fix/issue-5189 branch November 4, 2026 07:53
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.

Widget controller test misses its deliberate failure report

2 participants