From b0d01e492a1077b667260928e772c58c6dcffada Mon Sep 17 00:00:00 2001 From: allenliang2022 Date: Mon, 29 Jun 2026 01:22:40 +0800 Subject: [PATCH] fix(test): update run-journal reconnect anchor for the (1/N) template literal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test_error_reconnect_path_can_restore_from_journal anchored on the exact string setComposerStatus('Reconnecting — but the first status was changed to a template literal `Reconnecting… (1/${_retryDelays.length})` for the staged-probe counter, so that single-quoted anchor no longer exists (ValueError: substring not found in CI shard 2). Re-anchor on the block's stable entry point _reconnectAttempted=true; (unique in source) and widen the window to 1100 chars; the st.active / st.replay_available / Restoring stream / _runJournalReplayParams() assertions are unchanged. --- tests/test_run_journal_frontend_static.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/test_run_journal_frontend_static.py b/tests/test_run_journal_frontend_static.py index 68b8b548..4f0e2b4b 100644 --- a/tests/test_run_journal_frontend_static.py +++ b/tests/test_run_journal_frontend_static.py @@ -222,8 +222,12 @@ def test_reattach_path_uses_replay_when_status_reports_journal(): def test_error_reconnect_path_can_restore_from_journal(): - reconnect_pos = MESSAGES_SRC.index("setComposerStatus('Reconnecting") - block = MESSAGES_SRC[reconnect_pos : reconnect_pos + 900] + # Anchor on the reconnect block's stable entry point rather than the exact + # composer-status string: the first status was changed to a template literal + # `Reconnecting… (1/${_retryDelays.length})` (staged-probe counter), so the + # old single-quoted "setComposerStatus('Reconnecting" anchor no longer exists. + reconnect_pos = MESSAGES_SRC.index("_reconnectAttempted=true;") + block = MESSAGES_SRC[reconnect_pos : reconnect_pos + 1100] assert "st.active" in block assert "st.replay_available" in block