From 82bdec1373d60c5fe958a010bf9e41bdd62fc7fe Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Sun, 26 Jul 2026 11:23:12 -0700 Subject: [PATCH] test(terminal): assert bounded probe during stalled reveal Add assertion to verify that a stalled reveal operation makes exactly one `getMainBufferSnapshot` call, ensuring retry logic doesn't introduce redundant probes that would extend the timeout window before relay fallback. --- .../src/components/terminal-pane/pty-connection.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/renderer/src/components/terminal-pane/pty-connection.test.ts b/src/renderer/src/components/terminal-pane/pty-connection.test.ts index fcca165e249..e87b1e057f9 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection.test.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection.test.ts @@ -19898,6 +19898,9 @@ describe('connectPanePty', () => { await flushAsyncTicks(20) expect(writes).toContain('relay-fallback-output') + // Why: a stalled reveal must cost exactly one bounded probe — a re-probe + // would buy a second timeout window before the relay paint. + expect(window.api.pty.getMainBufferSnapshot).toHaveBeenCalledTimes(1) }) it('does not auto-reconnect after a user cancels deferred SSH passphrase auth', async () => {