From 6cb4fd1d2da032dcdd929292bd2c95066bbb71f6 Mon Sep 17 00:00:00 2001 From: Dylan Hurd Date: Wed, 25 Nov 2026 06:05:42 +0000 Subject: [PATCH] Drain stdout through closure in the PTY attachment test (#63894) The exit status can arrive before the PTY reader delivers its final bytes. Drain stdout to channel closure while awaiting the exit status so the test compares complete output with and without file descriptor attachments. GitOrigin-RevId: c695a1c1cd00c11071bd17523cfc2ca7effc697c --- codex-rs/utils/pty/src/tests.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/codex-rs/utils/pty/src/tests.rs b/codex-rs/utils/pty/src/tests.rs index d34ad0a673..542d947e04 100644 --- a/codex-rs/utils/pty/src/tests.rs +++ b/codex-rs/utils/pty/src/tests.rs @@ -1358,10 +1358,9 @@ async fn pty_attachments_preserve_shell_environment_and_signal_status() -> anyho unsafe { libc::fcntl(reader.as_raw_fd(), libc::F_GETFD) }, flags ); - let (_session, output_rx, exit_rx) = combine_spawned_output(spawned); let (bytes, status) = - collect_output_until_exit(output_rx, exit_rx, /*timeout_ms*/ 2_000).await; - assert_eq!(status, expected_status); + tokio::join!(collect_split_output(spawned.stdout_rx), spawned.exit_rx); + assert_eq!(status?, expected_status); output.push(bytes); } assert!(!output[0].is_empty());