test(e2e): script E6's heal turn explicitly

An exhausted script queue still settles — into the error arm, which the
idle-edge backstop also consumes — so the heal leg would have passed for
a reason the scenario does not name. Queue the fourth turn like E4/E5 and
assert its sentinel.
This commit is contained in:
Patrick Buckley
2026-07-24 15:54:42 -07:00
parent c0261c907c
commit 0a31709aed
+17 -2
View File
@@ -2804,7 +2804,16 @@ def run_await_window_gate(chrome: str) -> str:
after ``history_requests`` proves the held fetch both arrived AND
returned. Without the gate the render lands and stamps rows1-latch0,
because a successful replayHistory is the latch's only clear site."""
node, ws_id = _seed_three_completed_turns("browser-await-window-gate")
from tests._sse_recovery_server import final_text_script
# The heal-driving send needs its OWN scripted turn: an exhausted script
# queue still settles (into the error arm, which the backstop also
# consumes), so relying on it would let this scenario pass for a reason
# it does not name.
node, ws_id = _seed_three_completed_turns(
"browser-await-window-gate",
extra_scripts=(final_text_script(BACKSTOP_SENTINEL),),
)
profile = Path(_scratch()) / "chrome-await-window-gate"
proc, cdp_port = _launch_chrome(chrome, profile)
cdp: CDP | None = None
@@ -2852,7 +2861,13 @@ def run_await_window_gate(chrome: str) -> str:
raise AssertionError("await-window-gate: show-edge reconnect never arrived")
_send_in_page(cdp, "fourth turn")
healed = _poll_until(
lambda: cdp.evaluate(_ROWS_JS + " === 2 && window.__pane._historyStale === false"),
lambda: cdp.evaluate(
_ROWS_JS
+ " === 2 && window.__pane._historyStale === false"
+ " && (window.__pane.messagesEl.textContent||'').includes("
+ json.dumps(BACKSTOP_SENTINEL)
+ ")"
),
20,
0.2,
)