test: diagnose SSH input without an added focus-to-type round trip

This commit is contained in:
Neil
2026-09-06 05:52:22 -07:00
parent cf54ba01b1
commit e46d67b3d8
2 changed files with 20 additions and 19 deletions
+1 -1
View File
@@ -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:
@@ -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)