Skip to content

test: answer the requests a reloaded document makes after its held ones are released - #7161

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-7160
Nov 25, 2026
Merged

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

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

reload_in_a_row (tests/browser/startup/test_readiness.py) held every request a reloaded document made until the test had taken its step in that document. It then answered only the requests held at that moment. A request the document made after that release stayed held forever. That includes its /api/state read, which on a loaded runner can arrive after the layer's registry.json. The document never got the answer that tells it another Leaf is serving, so it never reloaded again, and the helper's next expect_navigation timed out. That is the test_a_value_typed_into_the_page_rides_two_reloads_in_a_row failure in run 45573880821: Page.expect_navigation: Timeout 120000ms exceeded. The failure screenshot shows the reloaded document still on "Connecting…".

From the moment a document's step runs, the helper now answers every request that document makes. The sibling helper reload_with_its_answers_held already does this with its released flag. What the three callers assert is unchanged.

Verification:

  • Forced ordering. An init script delays the reloaded document's /api/state fetch by 3 s. Before the change the test times out with the CI error; after it, the test passes.
  • Load. Before the change the test passed 54 unforced copies under load (leaf-dev suite flake, including --load 4 --cpu-throttle 4), so the race only shows on a slow enough runner. After the change, the helper's three callers each passed 8 of 8 copies under --load 2.

The same run's other failure, the Firefox node of test_a_card_s_turn_glided_into_sight_stays_there_as_the_transcript_above_grows, ran at 65a23a6. That commit comes before #7132, which fixed it (see #7142), so this PR leaves it alone.

Refs #7160 — automated triage

…re released

`reload_in_a_row` held every request a reloaded document made until its step
ran, then released only the requests held at that moment. A request the
document made after that release, such as `/api/state` arriving after the
layer's `registry.json` on a loaded runner, stayed held forever. The document
never got the answer that tells it to reload again, so the next
`expect_navigation` timed out after 120 s. From the moment a document's step
runs, the helper now answers every request that document makes, as
`reload_with_its_answers_held` already does. The behavior the tests protect is
unchanged.

Refs #7160
@leaf-agent
leaf-agent merged commit f41ae2f into main Nov 25, 2026
7 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-7160 branch November 25, 2026 11:03
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.

1 participant