mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-01-30 06:22:04 +00:00
fix: docker entrypoint test - set MCP_MODE=http for detached container
Root cause: 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 3 seconds, PID 1 no longer existed, causing the helper function to return null instead of the expected NODE_DB_PATH value. Solution: Add MCP_MODE=http 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 in the process environment. This fixes the last failing CI test in the fix/fts5-search-failures branch. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -240,8 +240,9 @@ describeDocker('Docker Entrypoint Script', () => {
|
||||
|
||||
// Use a path that the nodejs user can create
|
||||
// We need to check the environment inside the running process, not the initial shell
|
||||
// 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} -e NODE_DB_PATH=/tmp/custom/test.db -e AUTH_TOKEN=test ${imageName}`
|
||||
`docker run -d --name ${containerName} -e NODE_DB_PATH=/tmp/custom/test.db -e MCP_MODE=http -e AUTH_TOKEN=test ${imageName}`
|
||||
);
|
||||
|
||||
// Give it more time to start and stabilize
|
||||
|
||||
Reference in New Issue
Block a user