The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 22, 20:45 UTC
test(ssh): unreaped-server test no longer loses its zombie fixture (#22427)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 20, 2026 at 10:54 UTC
2893437f261dd50b96010dda3cbf518a28765b80
1 file changed
+10
packages/ssh/src/tunnel.test.ts
+10
@@ -1450,6 +1450,16 @@ server.listen(Number(flag("--port")), "127.0.0.1", () => {
1450
yield* parent.stdout.pipe(Stream.decodeText(), Stream.splitLines, Stream.runHead),
1451
),
1452
);
1453
+ // Until the parent execs, the shell still reaps its children, and a child killed then
1454
+ // never becomes a zombie. Wait for the parent to be the non-reaping sleep.
1455
+ const parentExec = yield* runScript(home, [
1456
+ "-c",
1457
+ `attempt=0; while [ "$attempt" -lt 1000 ]; do
1458
+ case "$(ps -o comm= -p ${parent.pid})" in *sleep) exit 0;; esac
1459
+ attempt=$((attempt + 1))
1460
+ done; exit 1`,
1461
+ ]);
1462
+ assert.equal(parentExec.exitCode, 0);
1463
process.kill(zombie, "SIGKILL");
1464
// SIGKILL delivery is asynchronous; establish the zombie fixture before launching.
1465
const zombieState = yield* runScript(home, [