test(desktop): shellSshDouble tolerates a child that exits before reading stdin

The spawn fixtures run commands that never read stdin, so on a fast Linux
runner the shell can exit before shellExec's stdin write lands and the
write fails with EPIPE. The stream had no error listener, so vitest
reported it as an unhandled error and failed the electron project even
though every test passed. The close verdict is the result; the EPIPE is
noise.
This commit is contained in:
Austin Pickett
2026-10-06 13:43:46 -04:00
committed by Austin Pickett
parent db6a9c65e6
commit 950ea4d51e

View File

@@ -49,6 +49,10 @@ export function shellExec(
failure.stderr = stderr
reject(failure)
})
// A command that exits without reading stdin (the spawn fixtures never do)
// closes the pipe under this write; the `close` verdict above is the result,
// so an EPIPE here must not surface as an unhandled error.
child.stdin.once('error', () => {})
child.stdin.end(stdinData ?? '')
})
}