Skip to content

Commit be616d1

Browse files
misrasaurabh1claude
andcommitted
fix: flush e2e test output to CI logs in real-time
Use print(flush=True) instead of logging.info for subprocess output so CI logs show progress in real-time instead of buffering until completion. Also set PYTHONUNBUFFERED=1 for the subprocess. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 74cbe2a commit be616d1

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

tests/scripts/end_to_end_test_java_tracer.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def run_test(expected_improvement_pct: int) -> bool:
5959

6060
env = os.environ.copy()
6161
env["PYTHONIOENCODING"] = "utf-8"
62+
env["PYTHONUNBUFFERED"] = "1"
6263
logging.info(f"Running command: {' '.join(command)}")
6364
logging.info(f"Working directory: {fixture_dir}")
6465
process = subprocess.Popen(
@@ -73,13 +74,11 @@ def run_test(expected_improvement_pct: int) -> bool:
7374

7475
output = []
7576
for line in process.stdout:
76-
logging.info(line.strip())
77+
print(line, end="", flush=True)
7778
output.append(line)
7879

7980
return_code = process.wait()
8081
stdout = "".join(output)
81-
if return_code != 0:
82-
logging.error(f"Full output:\n{stdout}")
8382

8483
if return_code != 0:
8584
logging.error(f"Command returned exit code {return_code}")

0 commit comments

Comments
 (0)