mirror of
https://github.com/openai/codex.git
synced 2026-11-25 23:30:49 +00:00
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
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user