Check terminal descendant quiescence without requiring PID reaping

This commit is contained in:
07akioni committed 2026-09-20 14:31:11 +08:00
1 parent 2f4b354253
commit 90f0dc8f7d
1 file changed
+3 -2
@@ -233,9 +233,10 @@ describe.skipIf(process.platform === 'win32')('terminal-bash real shell', () =>
const child = /CHILD=(\d+)/.exec(output)?.[1]
expect(child).toBeDefined()
const pid = Number(child)
expect(() => process.kill(pid, 0)).not.toThrow()
expect(processIsRunning(pid)).toBe(true)
await ctx.terminals.kill(agent, created.sessionId)
expect(() => process.kill(pid, 0)).toThrow()
// Linux can retain an exited descendant's PID until its parent reaps it.
expect(processIsRunning(pid)).toBe(false)
}, 10_000)
it('quiesces a disowned same-session descendant after the shell exits naturally', async () => {