Skip to content

The agent that grows with you

test(update): the refusing owner's output goes to a file, not an undrained pipe

Teknium5f3078222185
diff --git a/tests/hermes_cli/test_update_lock_windows_live.py b/tests/hermes_cli/test_update_lock_windows_live.py
index a8bab1948d0..909a51c5731 100644
--- a/tests/hermes_cli/test_update_lock_windows_live.py
+++ b/tests/hermes_cli/test_update_lock_windows_live.py
@@ -212,9 +212,12 @@ REFUSED = "so it was not run"
def _writer_fenced_or_refused(tmp_path: Path, install: Path, owner_args: list[str]) -> str:
import psutil
- owner = subprocess.Popen([sys.executable, "-c", *owner_args], stdin=subprocess.DEVNULL,
- stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, encoding="utf-8",
- errors="replace")
+ # Output to a file, not a pipe: nobody drains a pipe while we poll, and a refusal's traceback
+ # (it quotes the launcher argv) outgrows the pipe buffer and blocks the owner on write.
+ log = tmp_path / "owner.log"
+ with open(log, "wb") as sink:
+ owner = subprocess.Popen([sys.executable, "-c", *owner_args], stdin=subprocess.DEVNULL,
+ stdout=sink, stderr=subprocess.STDOUT)
pid_file, tree = tmp_path / "blocker.pid", []
def started() -> bool:
@@ -227,7 +230,8 @@ def _writer_fenced_or_refused(tmp_path: Path, install: Path, owner_args: list[st
time.sleep(0.1)
time.sleep(0.5) # an exiting owner's writer may still be starting
if not started():
- out = owner.communicate(timeout=30)[0]
+ owner.wait(timeout=30)
+ out = log.read_text(encoding="utf-8-sig", errors="replace")
assert owner.returncode != 0 and REFUSED in out, f"the owner neither ran nor refused its writer:\n{out}"
return "refused"
blocker = psutil.Process(int(pid_file.read_text(encoding="utf-8-sig")))