diff --git a/packages/cli/src/__tests__/ssh-cov.test.ts b/packages/cli/src/__tests__/ssh-cov.test.ts index dd1bfb5c..8cd2289c 100644 --- a/packages/cli/src/__tests__/ssh-cov.test.ts +++ b/packages/cli/src/__tests__/ssh-cov.test.ts @@ -1,7 +1,7 @@ /** * ssh-cov.test.ts — Coverage tests for shared/ssh.ts * - * Covers: spawnInteractive, sleep, killWithTimeout, startSshTunnel, + * Covers: spawnInteractive, sleep, startSshTunnel, * waitForSsh, SSH_BASE_OPTS, SSH_INTERACTIVE_OPTS */ @@ -13,8 +13,9 @@ import * as net from "node:net"; // Suppress stderr during tests — restored in afterAll to avoid contamination let stderrSpy: ReturnType; -const { spawnInteractive, sleep, killWithTimeout, startSshTunnel, waitForSsh, SSH_BASE_OPTS, SSH_INTERACTIVE_OPTS } = - await import("../shared/ssh.js"); +const { spawnInteractive, sleep, startSshTunnel, waitForSsh, SSH_BASE_OPTS, SSH_INTERACTIVE_OPTS } = await import( + "../shared/ssh.js" +); /** Create a fake socket (EventEmitter) that satisfies net.Socket interface for testing. */ function createFakeSocket(): net.Socket { @@ -158,38 +159,6 @@ describe("sleep", () => { }); }); -// ── killWithTimeout (additional coverage) ────────────────────────────── - -describe("killWithTimeout additional", () => { - it("sends SIGTERM immediately then SIGKILL after grace period", async () => { - const signals: (number | undefined)[] = []; - const proc = { - kill(signal?: number) { - signals.push(signal); - }, - }; - killWithTimeout(proc, 50); - expect(signals).toEqual([ - undefined, - ]); // SIGTERM sent immediately - await sleep(100); - expect(signals).toEqual([ - undefined, - 9, - ]); // SIGKILL sent after grace - }); - - it("does nothing when first kill throws (process already dead)", () => { - const proc = { - kill() { - throw new Error("No such process"); - }, - }; - // Should not throw - killWithTimeout(proc, 50); - }); -}); - // ── startSshTunnel ───────────────────────────────────────────────────── describe("startSshTunnel", () => {