From 6a5b818f657edc14bf437c56b8410e80920e92d4 Mon Sep 17 00:00:00 2001 From: Codeman maintainer Date: Fri, 20 Nov 2026 04:03:18 +0100 Subject: [PATCH] chore(docker): the two review items of #822 A comment says why the wait after the kill keeps its 2>/dev/null (bash 3.2 prints a Terminated job line there, bash 5.2 does not, so CI would not notice its removal), and the two probe tests use the file's own imports. Co-Authored-By: Claude Opus 5.5 --- docker/Start-Codeman.sh | 2 ++ test/docker-start-setup.test.ts | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/Start-Codeman.sh b/docker/Start-Codeman.sh index 68f573b4..4a8c9f45 100644 --- a/docker/Start-Codeman.sh +++ b/docker/Start-Codeman.sh @@ -168,6 +168,8 @@ port_answers() { while kill -0 "$pid" 2>/dev/null; do if ((tries >= 20)); then kill "$pid" 2>/dev/null + # The 2>/dev/null keeps bash 3.2 from printing a "Terminated" job line on + # the first-run path; bash 5.2 prints nothing without it, so CI won't notice. wait "$pid" 2>/dev/null return 1 fi diff --git a/test/docker-start-setup.test.ts b/test/docker-start-setup.test.ts index ecfee7b9..2138703f 100644 --- a/test/docker-start-setup.test.ts +++ b/test/docker-start-setup.test.ts @@ -38,7 +38,7 @@ import { symlinkSync, readdirSync, } from 'node:fs'; -import { execFileSync, spawnSync } from 'node:child_process'; +import { spawn, execFileSync, spawnSync } from 'node:child_process'; import { tmpdir } from 'node:os'; import { join } from 'node:path'; import { diffRequiredEnvKeys, parseEnvKeys } from '../src/web/self-update.js'; @@ -676,7 +676,6 @@ describe.skipIf(process.platform !== 'linux' || !HAS_PYTHON)('port_answers', () } it('gives up on a connect that gets no answer within about a second, and reads it as free', async () => { - const { spawn } = await import('node:child_process'); const child = spawn('python3', ['-I', '-c', SILENT_LISTENER], { stdio: ['ignore', 'pipe', 'ignore'] }); try { const port = await new Promise((resolve, reject) => { @@ -692,8 +691,7 @@ describe.skipIf(process.platform !== 'linux' || !HAS_PYTHON)('port_answers', () }); it('still answers at once for a listening port and a closed one', async () => { - const net = await import('node:net'); - const server = net.createServer(); + const server = createServer(); await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve)); const port = (server.address() as { port: number }).port; try {