Skip to content

Commit f145c04

Browse files
cdcore09claude
andcommitted
fix: Add PYTHONUNBUFFERED and increase test wait time for Docker logs
- Add PYTHONUNBUFFERED=1 to Dockerfile environment variables to disable Python's stdout/stderr buffering in containers - Increase test wait time from 2 to 5 seconds to allow logs to be written before checking them in test_docker_stdio_transport and test_docker_http_transport - This fixes the issue where Docker containers were running successfully but logs weren't visible immediately due to Python output buffering All Docker installation tests now pass locally. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent af427c3 commit f145c04

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ ENV HOLOVIZ_MCP_TRANSPORT=stdio \
7373
HOLOVIZ_MCP_HOST=0.0.0.0 \
7474
HOLOVIZ_MCP_PORT=8000 \
7575
HOLOVIZ_MCP_LOG_LEVEL=INFO \
76-
HOLOVIZ_MCP_ALLOW_CODE_EXECUTION=true
76+
HOLOVIZ_MCP_ALLOW_CODE_EXECUTION=true \
77+
PYTHONUNBUFFERED=1
7778

7879
# Create entrypoint script
7980
RUN echo '#!/bin/bash\n\

tests/test_installation.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ def test_docker_stdio_transport(self):
9999
# Check container status (may have exited for stdio, which is ok)
100100
assert status is not None and status.stdout.strip(), f"Container {container_name} not found or not ready after {max_wait} seconds"
101101

102+
# Wait a moment for the application to start and write logs
103+
time.sleep(5)
104+
102105
# Check logs for successful startup (container may exit with stdio transport, that's expected)
103106
logs = subprocess.run(
104107
["docker", "logs", container_name],
@@ -184,6 +187,9 @@ def test_docker_http_transport(self):
184187
)
185188
assert status.stdout.strip(), f"Container {container_name} is not running"
186189

190+
# Wait a moment for the application to start and write logs
191+
time.sleep(5)
192+
187193
# Check logs for successful startup
188194
logs = subprocess.run(
189195
["docker", "logs", container_name],

0 commit comments

Comments
 (0)