test: repeat command-probe recovery with control-frame fix

This commit is contained in:
Neil
2026-09-05 20:52:55 -07:00
parent 631e2b0d70
commit 3456e13d54
@@ -68,7 +68,8 @@ async function callRuntime<TResult>(page: Page, method: string, params: unknown)
) as Promise<TResult>
}
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()
}
})
}