From 482ca59282ac2ec97d3efc3db4887621b0d7e34d Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sat, 8 Aug 2026 01:50:40 -0700 Subject: [PATCH] test(terminal): poll the pane binding read so a slower host cannot flake it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `readPaneBinding` took a single unpolled read of a DOM dataset attribute immediately after a renderer reload, while its sibling helper polls the same data for 15s. On a native Linux host both tests failed every run with 'No bound terminal pane is mounted' while the app was demonstrably healthy — the screenshot showed the terminal restored with a live prompt and the boot PID echoed. The assertion is unchanged; it is only awaited. Nothing is weakened. Found by running this spec on native Linux rather than assuming macOS behaviour generalises. Co-authored-by: Orca --- .../local-terminal-restart-binding-identity.spec.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/e2e/local-terminal-restart-binding-identity.spec.ts b/tests/e2e/local-terminal-restart-binding-identity.spec.ts index 5176e64ffa5..0b45b261c1e 100644 --- a/tests/e2e/local-terminal-restart-binding-identity.spec.ts +++ b/tests/e2e/local-terminal-restart-binding-identity.spec.ts @@ -86,6 +86,16 @@ function readOsProcessIdentity(pid: number): OsProcessIdentity { } async function readPaneBinding(page: Page): Promise { + // Why poll: the binding is read off a DOM dataset attribute, and a reload + // remounts the pane before it republishes. A single read here failed every + // run on a slower host while the app was demonstrably healthy — the + // assertion is unchanged, it is just awaited. + await expect + .poll(async () => (await readPaneIdentitySnapshot(page))?.panes[0]?.ptyId ?? null, { + timeout: 30_000, + message: 'No bound terminal pane is mounted' + }) + .not.toBeNull() const snapshot = await readPaneIdentitySnapshot(page) const pane = snapshot?.panes[0] if (!snapshot || !pane?.ptyId) {