mirror of
https://github.com/openai/codex.git
synced 2026-11-17 22:10:37 +00:00
chore: enforce argument-comment lint across all targets
This commit is contained in:
@@ -426,7 +426,7 @@ async fn pipe_process_round_trips_stdin() -> anyhow::Result<()> {
|
||||
drop(writer);
|
||||
session.close_stdin();
|
||||
|
||||
let (output, code) = collect_output_until_exit(output_rx, exit_rx, 5_000).await;
|
||||
let (output, code) = collect_output_until_exit(output_rx, exit_rx, /*timeout_ms*/ 5_000).await;
|
||||
let text = String::from_utf8_lossy(&output);
|
||||
|
||||
assert!(
|
||||
@@ -535,7 +535,7 @@ async fn pipe_drains_stderr_without_stdout_activity() -> anyhow::Result<()> {
|
||||
let spawned = spawn_pipe_process(&python, &args, Path::new("."), &env_map, &None).await?;
|
||||
let (_session, output_rx, exit_rx) = combine_spawned_output(spawned);
|
||||
|
||||
let (output, code) = collect_output_until_exit(output_rx, exit_rx, 10_000).await;
|
||||
let (output, code) = collect_output_until_exit(output_rx, exit_rx, /*timeout_ms*/ 10_000).await;
|
||||
|
||||
assert_eq!(code, 0, "expected python to exit cleanly");
|
||||
assert!(!output.is_empty(), "expected stderr output to be drained");
|
||||
@@ -644,7 +644,7 @@ async fn pty_terminate_kills_background_children_in_same_process_group() -> anyh
|
||||
.await?;
|
||||
let (session, mut output_rx, _exit_rx) = combine_spawned_output(spawned);
|
||||
|
||||
let bg_pid = match wait_for_marker_pid(&mut output_rx, marker, 2_000).await {
|
||||
let bg_pid = match wait_for_marker_pid(&mut output_rx, marker, /*timeout_ms*/ 2_000).await {
|
||||
Ok(pid) => pid,
|
||||
Err(err) => {
|
||||
session.terminate();
|
||||
@@ -658,7 +658,7 @@ async fn pty_terminate_kills_background_children_in_same_process_group() -> anyh
|
||||
|
||||
session.terminate();
|
||||
|
||||
let exited = wait_for_process_exit(bg_pid, 3_000).await?;
|
||||
let exited = wait_for_process_exit(bg_pid, /*timeout_ms*/ 3_000).await?;
|
||||
if !exited {
|
||||
let _ = unsafe { libc::kill(bg_pid, libc::SIGKILL) };
|
||||
}
|
||||
@@ -708,7 +708,7 @@ async fn pty_spawn_can_preserve_inherited_fds() -> anyhow::Result<()> {
|
||||
drop(write_end);
|
||||
|
||||
let (_session, output_rx, exit_rx) = combine_spawned_output(spawned);
|
||||
let (_, code) = collect_output_until_exit(output_rx, exit_rx, 2_000).await;
|
||||
let (_, code) = collect_output_until_exit(output_rx, exit_rx, /*timeout_ms*/ 2_000).await;
|
||||
assert_eq!(code, 0, "expected preserved-fd PTY child to exit cleanly");
|
||||
|
||||
let mut pipe_output = String::new();
|
||||
@@ -762,14 +762,19 @@ async fn pty_preserving_inherited_fds_keeps_python_repl_running() -> anyhow::Res
|
||||
let (session, mut output_rx, exit_rx) = combine_spawned_output(spawned);
|
||||
let writer = session.writer_sender();
|
||||
let newline = "\n";
|
||||
let mut output =
|
||||
wait_for_python_repl_ready_via_probe(&writer, &mut output_rx, 5_000, newline).await?;
|
||||
let mut output = wait_for_python_repl_ready_via_probe(
|
||||
&writer,
|
||||
&mut output_rx,
|
||||
/*timeout_ms*/ 5_000,
|
||||
newline,
|
||||
)
|
||||
.await?;
|
||||
let marker = "__codex_preserved_py_pid:";
|
||||
writer
|
||||
.send(format!("import os; print('{marker}' + str(os.getpid())){newline}").into_bytes())
|
||||
.await?;
|
||||
|
||||
let python_pid = match wait_for_marker_pid(&mut output_rx, marker, 2_000).await {
|
||||
let python_pid = match wait_for_marker_pid(&mut output_rx, marker, /*timeout_ms*/ 2_000).await {
|
||||
Ok(pid) => pid,
|
||||
Err(err) => {
|
||||
session.terminate();
|
||||
@@ -782,7 +787,8 @@ async fn pty_preserving_inherited_fds_keeps_python_repl_running() -> anyhow::Res
|
||||
);
|
||||
|
||||
writer.send(format!("exit(){newline}").into_bytes()).await?;
|
||||
let (remaining_output, code) = collect_output_until_exit(output_rx, exit_rx, 5_000).await;
|
||||
let (remaining_output, code) =
|
||||
collect_output_until_exit(output_rx, exit_rx, /*timeout_ms*/ 5_000).await;
|
||||
output.extend_from_slice(&remaining_output);
|
||||
|
||||
assert_eq!(code, 0, "expected python to exit cleanly");
|
||||
@@ -871,7 +877,12 @@ async fn pty_spawn_with_inherited_fds_supports_resize() -> anyhow::Result<()> {
|
||||
|
||||
let (session, mut output_rx, exit_rx) = combine_spawned_output(spawned);
|
||||
let writer = session.writer_sender();
|
||||
let mut output = wait_for_output_contains(&mut output_rx, "start:31 101\r\n", 5_000).await?;
|
||||
let mut output = wait_for_output_contains(
|
||||
&mut output_rx,
|
||||
"start:31 101\r\n",
|
||||
/*timeout_ms*/ 5_000,
|
||||
)
|
||||
.await?;
|
||||
|
||||
session.resize(TerminalSize {
|
||||
rows: 45,
|
||||
@@ -880,7 +891,8 @@ async fn pty_spawn_with_inherited_fds_supports_resize() -> anyhow::Result<()> {
|
||||
writer.send(b"go\n".to_vec()).await?;
|
||||
session.close_stdin();
|
||||
|
||||
let (remaining_output, code) = collect_output_until_exit(output_rx, exit_rx, 5_000).await;
|
||||
let (remaining_output, code) =
|
||||
collect_output_until_exit(output_rx, exit_rx, /*timeout_ms*/ 5_000).await;
|
||||
output.extend_from_slice(&remaining_output);
|
||||
let text = String::from_utf8_lossy(&output);
|
||||
let normalized = text.replace("\r\n", "\n");
|
||||
@@ -933,7 +945,7 @@ async fn pipe_spawn_no_stdin_can_preserve_inherited_fds() -> anyhow::Result<()>
|
||||
drop(write_end);
|
||||
|
||||
let (_session, output_rx, exit_rx) = combine_spawned_output(spawned);
|
||||
let (_, code) = collect_output_until_exit(output_rx, exit_rx, 2_000).await;
|
||||
let (_, code) = collect_output_until_exit(output_rx, exit_rx, /*timeout_ms*/ 2_000).await;
|
||||
assert_eq!(code, 0, "expected preserved-fd pipe child to exit cleanly");
|
||||
|
||||
let mut pipe_output = String::new();
|
||||
|
||||
Reference in New Issue
Block a user