mirror of
https://github.com/stablyai/orca.git
synced 2026-09-23 08:02:31 +00:00
test(terminal): poll the pane binding read so a slower host cannot flake it
`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 <help@stably.ai>
This commit is contained in:
@@ -86,6 +86,16 @@ function readOsProcessIdentity(pid: number): OsProcessIdentity {
|
||||
}
|
||||
|
||||
async function readPaneBinding(page: Page): Promise<PaneBinding> {
|
||||
// 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) {
|
||||
|
||||
Reference in New Issue
Block a user