From e46d67b3d862b537cc924acbebf2a006f1d1bb39 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sun, 6 Sep 2026 05:52:22 -0700 Subject: [PATCH] test: diagnose SSH input without an added focus-to-type round trip --- .github/workflows/e2e.yml | 2 +- ...docker-five-pane-input-under-flood.spec.ts | 37 ++++++++++--------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index c4fdccf2c6c..58134b05000 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -21,7 +21,7 @@ jobs: pnpm run build:relay pnpm exec electron-vite build --mode e2e - name: Five panes under flood - run: xvfb-run --auto-servernum bash .github/scripts/e2e-with-window-manager.sh env SKIP_BUILD=1 ORCA_E2E_SSH_DOCKER=1 ORCA_E2E_FORWARD_APP_LOGS=1 pnpm exec playwright test --config tests/playwright.config.ts tests/e2e/ssh-docker-five-pane-input-under-flood.spec.ts --project=electron-headless --workers=1 --repeat-each=3 + run: xvfb-run --auto-servernum bash .github/scripts/e2e-with-window-manager.sh env SKIP_BUILD=1 ORCA_E2E_SSH_DOCKER=1 ORCA_E2E_FORWARD_APP_LOGS=1 pnpm exec playwright test --config tests/playwright.config.ts tests/e2e/ssh-docker-five-pane-input-under-flood.spec.ts --project=electron-headless --workers=1 --repeat-each=5 - uses: actions/upload-artifact@v7 if: failure() with: diff --git a/tests/e2e/ssh-docker-five-pane-input-under-flood.spec.ts b/tests/e2e/ssh-docker-five-pane-input-under-flood.spec.ts index 7cb379cf1f1..24424b24fa0 100644 --- a/tests/e2e/ssh-docker-five-pane-input-under-flood.spec.ts +++ b/tests/e2e/ssh-docker-five-pane-input-under-flood.spec.ts @@ -73,7 +73,7 @@ test.describe('five SSH panes under simultaneous output', () => { const visibleTerminals = orcaPage.locator('.xterm:visible') await expect(visibleTerminals).toHaveCount(5) - for (let round = 0; round < 2; round++) { + for (let round = 0; round < 10; round++) { await orcaPage.evaluate(() => window.__store!.getState().setActiveView('tasks')) await expect .poll(() => orcaPage.evaluate(() => window.__store!.getState().activeView)) @@ -83,6 +83,24 @@ test.describe('five SSH panes under simultaneous output', () => { await expect(visibleTerminals).toHaveCount(5) await waitForActiveTerminalManager(orcaPage, 60_000) for (const [index, owner] of owners.entries()) { + const inputTrace = await orcaPage.evaluateHandle((tabId) => { + const manager = window.__paneManagers!.get(tabId)! + const entries = manager.getPanes().map((pane) => ({ + ptyId: pane.container.dataset.ptyId, + data: '', + focusedAtFirstInput: null as boolean | null + })) + const subscriptions = manager.getPanes().map((pane, index) => + pane.terminal.onData((data) => { + entries[index].focusedAtFirstInput ??= pane.container.contains(document.activeElement) + entries[index].data = (entries[index].data + data).slice(-512) + }) + ) + return { + entries, + dispose: () => subscriptions.forEach((subscription) => subscription.dispose()) + } + }, tabId) await orcaPage.evaluate( ({ tabId, leafId }) => { const manager = window.__paneManagers!.get(tabId)! @@ -97,23 +115,6 @@ test.describe('five SSH panes under simultaneous output', () => { expect(await waitForActivePanePtyId(orcaPage)).toBe(owner.ptyId) await focusActiveTerminalInput(orcaPage) const input = `input_${runId}_${round}_${index}` - const inputTrace = await orcaPage.evaluateHandle((tabId) => { - const manager = window.__paneManagers!.get(tabId)! - const entries = manager.getPanes().map((pane) => ({ - ptyId: pane.container.dataset.ptyId, - data: '', - focusedBefore: pane.container.contains(document.activeElement) - })) - const subscriptions = manager.getPanes().map((pane, index) => - pane.terminal.onData((data) => { - entries[index].data = (entries[index].data + data).slice(-512) - }) - ) - return { - entries, - dispose: () => subscriptions.forEach((subscription) => subscription.dispose()) - } - }, tabId) // The remote process repeats its latest ACK, so flood eviction cannot hide it. try { await orcaPage.keyboard.type(input)