fix(ssh): harden relay repair cancellation and locking

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
Jinwoo-H
2026-07-16 16:12:47 -04:00
co-authored by Orca
parent 3eeec1c100
commit 04371c3d82
24 changed files with 1793 additions and 535 deletions
+9
View File
@@ -507,6 +507,15 @@ describe('spawnSystemSsh', () => {
expect(mockProc.stdin.end).toHaveBeenCalledWith('contents')
})
it('marks a system command channel when local teardown is requested', () => {
const channel = spawnSystemSshCommand(createTarget(), 'npm install')
channel.close()
expect(channel._closeRequested).toBe(true)
expect(mockProc.kill).toHaveBeenCalledWith('SIGTERM')
})
it('removes wrapped process listeners after command close', () => {
const proc = createEventedProcess()
spawnMock.mockReturnValue(proc)