Skip to content

Commit aac3616

Browse files
committed
test(windows): keep and dump the worker log for the failing CLI probe
The CLI probe reproduces the empty pipeline (rc=1, same one-line hint), so the remaining record is the worker's own log -- which the supervisor unlinks on a clean exit. CBM_PROFILE=1 flips that exact branch to retention (index.supervisor.profile_log) with no product change, and the probe now prints every retained log tail from its isolated cache. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 591155d commit aac3616

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

‎tests/windows/test_non_ascii_path.py‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,13 @@ def main():
378378
else:
379379
# The MCP result hides the pipeline's own diagnostics; the
380380
# CLI entrypoint prints them. Same repo, third fresh cache.
381+
cli_cache = os.path.join(work, "c3_" + key)
381382
cli_env = os.environ.copy()
382-
cli_env["CBM_CACHE_DIR"] = os.path.join(work, "c3_" + key)
383+
cli_env["CBM_CACHE_DIR"] = cli_cache
384+
# CBM_PROFILE keeps the supervisor from unlinking the worker
385+
# log on a clean exit (index.supervisor.profile_log), which
386+
# is the only record of the pipeline's own diagnostics.
387+
cli_env["CBM_PROFILE"] = "1"
383388
cli = subprocess.run(
384389
[binary, "cli", "index_repository",
385390
json.dumps({"repo_path": repo})],
@@ -389,6 +394,16 @@ def main():
389394
print(" %s cli probe rc=%s\n stdout: %s\n"
390395
" stderr: %s" % (key, cli.returncode,
391396
cli_out[-900:], cli_err[-900:]))
397+
probe_logs = os.path.join(cli_cache, "logs")
398+
if os.path.isdir(probe_logs):
399+
for log_name in sorted(os.listdir(probe_logs)):
400+
try:
401+
with open(os.path.join(probe_logs, log_name), "rb") as lf:
402+
tail = lf.read()[-1500:].decode("utf-8", "replace")
403+
except OSError as exc:
404+
tail = "<unreadable: %s>" % exc
405+
print(" %s worker log %s:\n%s"
406+
% (key, log_name, tail))
392407
failures.append(key)
393408
finally:
394409
shutil.rmtree(work, ignore_errors=True)

0 commit comments

Comments
 (0)