Skip to content

fix: wait for returning widget error reports in browser test - #5108

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-5094
Nov 2, 2026
Merged

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

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

The reconnect test read browser errors before the second failure's console report arrived. #4966 intentionally deferred fault reporting until after the native operation, so removing an iframe does not report its canceled requests as page failures; presentation completion no longer implies console delivery.

Wait for the matching console event around each deliberate failed draw. The existing assertions still require two failures, two reports, a reconnect repaint, and no pending presentation work. No product behavior changes.

Validation: the focused test_a_returning_widget_repaints_to_restore_subscriptions failed before this change with the reported one-versus-two mismatch and passes afterward (uv run pytest tests/browser/test_render_application_boundary.py::test_a_returning_widget_repaints_to_restore_subscriptions -q -n0). Formatting and git diff --check pass.

Closes #5094 — automated triage

Fault reports moved to the next task in #4966 to distinguish native document removal from genuine page faults. The reconnect test read its console records after presentation settled, before the deferred second report arrived. Wait for the console event around each failed draw, retaining both error, repaint and readiness assertions.

Closes #5094
@leaf-agent
leaf-agent merged commit a31a3a8 into main Nov 2, 2026
5 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-5094 branch November 2, 2026 11:12
max-sixty pushed a commit that referenced this pull request Nov 4, 2026
…rs (#5312)

`test_widget_controller_owns_presentation_across_values_and_lifetimes`
intermittently read no browser errors on the scheduled macOS job ([run
41432142330](https://github.com/max-sixty/leaf/actions/runs/41432142330)
for `light` and `shadow-child`, [run
41622727492](https://github.com/max-sixty/leaf/actions/runs/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

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 widget emits one refusal where the test expects two

1 participant