From 0a31709aedcd5af0f4ecbd8c8b294264f6a78210 Mon Sep 17 00:00:00 2001 From: Patrick Buckley Date: Fri, 24 Jul 2026 15:54:42 -0700 Subject: [PATCH] test(e2e): script E6's heal turn explicitly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- scripts/recovery_e2e.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/scripts/recovery_e2e.py b/scripts/recovery_e2e.py index 3abb6dcf..7701ab5d 100644 --- a/scripts/recovery_e2e.py +++ b/scripts/recovery_e2e.py @@ -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, )