From b8227ff7755ba695596e0090f36a9ecc6f51003b Mon Sep 17 00:00:00 2001 From: czlonkowski <56956555+czlonkowski@users.noreply.github.com> Date: Fri, 10 Oct 2025 10:33:31 +0200 Subject: [PATCH] fix: docker-config test - set MCP_MODE=http for detached container MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root cause: Same issue as docker-entrypoint.test.ts - test was starting container in detached mode without setting MCP_MODE. The node application defaulted to stdio mode, which expects JSON-RPC input on stdin. In detached Docker mode, stdin is /dev/null, causing the process to receive EOF and exit immediately. When the test tried to check /proc/1/environ after 2 seconds to verify NODE_DB_PATH from config file, PID 1 no longer existed, causing the test to fail with "container is not running". Solution: Add MCP_MODE=http and AUTH_TOKEN=test to the docker run command so the HTTP server starts and keeps the container running, allowing the test to verify that NODE_DB_PATH is correctly set from the config file. This fixes the last failing CI test: - Before: 678 passed | 1 failed | 27 skipped - After: 679 passed | 0 failed | 27 skipped ✅ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- tests/integration/docker/docker-config.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/integration/docker/docker-config.test.ts b/tests/integration/docker/docker-config.test.ts index f1c9358..005a94a 100644 --- a/tests/integration/docker/docker-config.test.ts +++ b/tests/integration/docker/docker-config.test.ts @@ -269,8 +269,9 @@ describeDocker('Docker Config File Integration', () => { fs.writeFileSync(configPath, JSON.stringify(config)); // Run container in detached mode to check environment after initialization + // Set MCP_MODE=http so the server keeps running (stdio mode exits when stdin is closed in detached mode) await exec( - `docker run -d --name ${containerName} -v "${configPath}:/app/config.json:ro" ${imageName}` + `docker run -d --name ${containerName} -e MCP_MODE=http -e AUTH_TOKEN=test -v "${configPath}:/app/config.json:ro" ${imageName}` ); // Give it time to load config and start