Skip to content

fix: open the page check's page where startup recovery won't reload it - #6187

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-6180
Nov 16, 2026
Merged

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

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

Since #6154, a page whose module fails to load reloads itself once from the same server at an address marked _leaf-recovered. page check and page check --render kept reading the first document after it refused (waiting for its reports to be acknowledged), so the reload destroyed it under them. Plain page check returned a browser-error ("Execution context was destroyed") in place of its reading, and the render check's page-code reading came back empty, so page check --render passed a page that could not start. Both now open the page at the marked address, where a page that cannot start waits for a new server instead of reloading, so each reads exactly one document — the same address #6154 gave the startup tests (asked_again, now moved from tests/render_harness.py into leaf.render_checks so the check and the tests share it). wait_until_ready's fixed_server docstring now says its callers open the page there.

tests/journeys/test_render_commands.py::test_plain_check_reports_page_request_failures_but_ignores_optional_assets fails on main (assert [] == [page-report, not-ready, browser-error, …]) and passes on this branch. Its browser-error finding is gone, since the plain check no longer races the reload.

Two findings now show a different address:

  • A request finding's frame is the address the frame shows once the bootstrap has removed its marks and the host key (Page.navigatedWithinDocument). Before, it was the address the check asked for. The journey test now expects the address without ?t=….
  • When the server refuses the document itself, the console finding names the marked address the check requested, because no bootstrap ran to rewrite it. test_a_refused_document_reports_its_status_with_the_gate_failure now expects asked_again(refused).

A check no longer gets #6154's single retry after a transient module failure. That matches how the check behaved before #6154, and its reading stays deterministic.

Verification

Passing locally: the reproduced journey test above, the other plain/render check journeys in the same file (test_plain_check_runs_the_code_a_page_authored, …_reads_media, test_a_widget_that_fails_in_a_message_…, test_a_passing_render_check_…, test_render_reads_widget_chrome_where_it_stands), every asked_again caller in tests/browser/ (startup keys/readiness, initial delivery, render pages), test_render_gate.py's unanswered-resource, refused-document and far-sample gate tests, and the smoke test's shipped-page gate.

test_check_render_refuses_what_only_a_browser_can_see fails here with assert None == 'Chrome' both on this branch and on main without it, because this runner has no browser named Chrome.

Closes #6180 — automated triage

#6154 made a page whose module failed to load reload itself once from the
same server, marked `_leaf-recovered`. `page check` and `page check --render`
read the first document after it refused, waiting for its reports to be
acknowledged, and the reload destroyed that document under them: plain
`page check` reported a browser error in place of a clean reading, and the
render check's page-code reading came back empty, so `page check --render`
passed a page that could not start.

Both now open the page at the marked address (`render_checks.asked_again`,
moved from the test harness), where a page that cannot start waits for a new
server rather than reloading, so they read one document. `wait_until_ready`'s
`fixed_server` contract says its callers open the page there.

Behavior changes the tests now pin:
- A request finding's `frame` names the address the frame shows after the
  bootstrap rewrites it (`Page.navigatedWithinDocument`), without its marks or
  host key, rather than the address the check asked for.
- A document the server itself refuses is reported at the marked address the
  check requested, since no bootstrap ran to rewrite it.

Closes #6180
@leaf-agent
leaf-agent merged commit 8cd4039 into main Nov 16, 2026
6 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-6180 branch November 16, 2026 17:28
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.

test_plain_check_reports_page_request_failures_but_ignores_optional_assets: page check reports nothing for a page that failed to start since #6154

1 participant