From 69fa466aad29484fde0860bef728e75fcf476fe4 Mon Sep 17 00:00:00 2001 From: Dylan Hurd Date: Thu, 26 Mar 2026 08:34:47 -0700 Subject: [PATCH] tests: skip seatbelt python prompt when localhost bind is blocked --- codex-rs/core/tests/suite/unified_exec.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/codex-rs/core/tests/suite/unified_exec.rs b/codex-rs/core/tests/suite/unified_exec.rs index 2f72277086..a8363d8cb1 100644 --- a/codex-rs/core/tests/suite/unified_exec.rs +++ b/codex-rs/core/tests/suite/unified_exec.rs @@ -2700,6 +2700,11 @@ async fn unified_exec_runs_under_sandbox() -> Result<()> { async fn unified_exec_python_prompt_under_seatbelt() -> Result<()> { skip_if_no_network!(Ok(())); + if let Err(err) = std::net::TcpListener::bind("127.0.0.1:0") { + eprintln!("unable to bind localhost for mock server, skipping test: {err}"); + return Ok(()); + } + let python = match which::which("python").or_else(|_| which::which("python3")) { Ok(path) => path, Err(_) => {