From 8a94be037318cf662676c9a40204ee893d6dae24 Mon Sep 17 00:00:00 2001 From: Ryan Fowler Date: Mon, 17 Aug 2026 09:12:51 -0400 Subject: [PATCH] test: synchronize image rendering PTY output --- tests/support/terminal.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/support/terminal.rs b/tests/support/terminal.rs index 74ee4b4..61927e9 100644 --- a/tests/support/terminal.rs +++ b/tests/support/terminal.rs @@ -72,6 +72,9 @@ pub(crate) fn run_image_render_pty(env: Vec<(String, String)>) -> String { } configure_pty_child(&mut cmd, &pty.slave); let mut child = cmd.spawn().expect("spawn fetch under PTY"); + // Close the parent-owned slave handles so the capture thread can observe + // EOF after the child exits. + drop(cmd); drop(pty.slave); let capture = start_pty_capture(&pty.master); let status = wait_child(&mut child, Duration::from_secs(3)) @@ -88,10 +91,8 @@ pub(crate) fn run_image_render_pty(env: Vec<(String, String)>) -> String { "fetch exited with {status}; PTY output:\n{}", capture.output() ); - let output = capture.output(); drop(pty.master); - capture.close(); - output + capture.finish() } #[cfg(unix)]