From 87cf20ee491a035036f2d905926df4a0d35951cc Mon Sep 17 00:00:00 2001 From: jif Date: Wed, 9 Sep 2026 20:14:52 +0000 Subject: [PATCH] Isolate the hook pipe I/O timeout test from shell startup files (#44297) Run `hook_drains_output_and_times_out_while_stdin_is_blocked` with `cmd.exe /D /C` on Windows and `/bin/sh -c` elsewhere to keep user shell startup files out of the test. GitOrigin-RevId: 296e65cf76b74543e91c9ed9024ba2442e7e33af --- codex-rs/hooks/src/engine/command_runner_tests.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/codex-rs/hooks/src/engine/command_runner_tests.rs b/codex-rs/hooks/src/engine/command_runner_tests.rs index 644a9de6fb..d11da77656 100644 --- a/codex-rs/hooks/src/engine/command_runner_tests.rs +++ b/codex-rs/hooks/src/engine/command_runner_tests.rs @@ -262,6 +262,19 @@ time.sleep(30) let input_json = format!(r#"{{"padding":"{}"}}"#, "x".repeat(1024 * 1024)); let (runtime, _result_receiver) = runtime(); + // Keep user shell startup files out of the pipe I/O timeout test. + let runtime = runtime.reconfigured(if cfg!(windows) { + CommandShell { + program: "cmd.exe".to_string(), + args: vec!["/D".to_string(), "/C".to_string()], + } + } else { + CommandShell { + program: "/bin/sh".to_string(), + args: vec!["-c".to_string()], + } + }); + let result = timeout( Duration::from_secs(10), run_command(&runtime, &handler, command, env, &input_json, temp.path()),