From 3456e13d54b117db5f761c8352efd618c6c4dbdb Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sat, 5 Sep 2026 20:52:55 -0700 Subject: [PATCH] test: repeat command-probe recovery with control-frame fix --- ...remote-terminal-probe-gap-recovery.spec.ts | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/tests/e2e/paired-remote-terminal-probe-gap-recovery.spec.ts b/tests/e2e/paired-remote-terminal-probe-gap-recovery.spec.ts index 9cd76f0d3e5..17984fd3d95 100644 --- a/tests/e2e/paired-remote-terminal-probe-gap-recovery.spec.ts +++ b/tests/e2e/paired-remote-terminal-probe-gap-recovery.spec.ts @@ -68,7 +68,8 @@ async function callRuntime(page: Page, method: string, params: unknown) ) as Promise } -test('replaces a stale paired stream when the PTY snapshot advanced @headful', async ({ +for (const repetition of [1, 2, 3, 4, 5]) { +test(`replaces a stale paired stream when the PTY snapshot advanced ${repetition} @headful`, async ({ electronApp, orcaPage }) => { @@ -146,6 +147,18 @@ test('replaces a stale paired stream when the PTY snapshot advanced @headful', a return gate.dropOutputUntilResubscribe([target]) }, terminal) ).toBe(1) + await client.page.evaluate(() => { + const target = window as typeof window & { __probeBreadcrumbs?: unknown[] } + target.__probeBreadcrumbs = [] + const record = window.api.crashReports.recordBreadcrumb + window.api.crashReports.recordBreadcrumb = (entry) => { + if (entry.name.startsWith('remote_terminal')) { + target.__probeBreadcrumbs!.push({ time: performance.now(), ...entry }) + target.__probeBreadcrumbs = target.__probeBreadcrumbs!.slice(-100) + } + return record(entry) + } + }) const missingMarker = `PROBE_GAP_MISSING_${Date.now()}` await client.page.keyboard.type(missingMarker) await client.page.keyboard.press('Enter') @@ -217,6 +230,17 @@ test('replaces a stale paired stream when the PTY snapshot advanced @headful', a .toContain(`${liveMarker}\n`) expect(await waitForActivePanePtyId(client.page, 30_000)).toBe(originalPtyId) } finally { + console.info('[probe-gap-diagnostics] ' + JSON.stringify(await client.page.evaluate(() => { + const target = window as typeof window & { + __probeBreadcrumbs?: unknown[] + __remoteTerminalMultiplexAckGate?: { snapshot: () => unknown } + } + return { + breadcrumbs: target.__probeBreadcrumbs, + streams: target.__remoteTerminalMultiplexAckGate?.snapshot(), + visibility: document.visibilityState + } + }).catch((error) => ({ diagnosticError: String(error) })))) await client.page .evaluate(() => { ;( @@ -232,3 +256,5 @@ test('replaces a stale paired stream when the PTY snapshot advanced @headful', a await client.dispose() } }) + +}