diff --git a/codex-rs/app-server/tests/suite/v2/config_server_tests.rs b/codex-rs/app-server/tests/suite/v2/config_server_tests.rs index b936158273..03edf525fc 100644 --- a/codex-rs/app-server/tests/suite/v2/config_server_tests.rs +++ b/codex-rs/app-server/tests/suite/v2/config_server_tests.rs @@ -64,9 +64,7 @@ async fn config_server_settings_survive_openai_login_and_logout() -> Result<()> let started = app.start_thread(ThreadStartParams::default()).await?; setup .assert_turn_uses_managed_instructions(&mut app, &started.thread.id) - .await?; - app.shutdown_gracefully().await?; - Ok(()) + .await } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] diff --git a/codex-rs/app-server/tests/suite/v2/guardian_action_budget_tests.rs b/codex-rs/app-server/tests/suite/v2/guardian_action_budget_tests.rs index d9b7291651..f04b37af29 100644 --- a/codex-rs/app-server/tests/suite/v2/guardian_action_budget_tests.rs +++ b/codex-rs/app-server/tests/suite/v2/guardian_action_budget_tests.rs @@ -129,18 +129,26 @@ with urllib.request.urlopen(request, timeout=30) as response: )) .enable_feature(Feature::GuardianApproval) .write(codex_home.path())?; + // The permission hooks run on the host and call back to its loopback server. + // Their working directory must exist on that host even in remote-executor CI. let mut app_server = TestAppServer::builder() .with_codex_home(codex_home.path()) + .without_auto_env() + .with_env_overrides(&[(codex_exec_server::CODEX_EXEC_SERVER_URL_ENV_VAR, None)]) .build_initialized_with_timeout(TIMEOUT) .await?; - let thread = app_server - .start_thread(ThreadStartParams::default()) - .await? - .thread; + let start = app_server + .send_thread_start_request(ThreadStartParams { + cwd: Some(codex_home.path().display().to_string()), + ..Default::default() + }) + .await?; + let thread: codex_app_server_protocol::ThreadStartResponse = + timeout(TIMEOUT, app_server.read_response(start)).await??; state.allow_guardian_review.notify_one(); let id = app_server .send_turn_start_request(TurnStartParams { - thread_id: thread.id, + thread_id: thread.thread.id, input: vec![UserInput::Text { text: USER_CONTEXT.to_owned(), text_elements: Vec::new(), diff --git a/codex-rs/app-server/tests/suite/v2/process_exec.rs b/codex-rs/app-server/tests/suite/v2/process_exec.rs index 6deeb8a422..e7eeb76a03 100644 --- a/codex-rs/app-server/tests/suite/v2/process_exec.rs +++ b/codex-rs/app-server/tests/suite/v2/process_exec.rs @@ -38,7 +38,7 @@ async fn process_spawn_returns_before_exit_and_emits_exit_notification() -> Resu "-NonInteractive".to_string(), "-Command".to_string(), concat!( - "[IO.File]::WriteAllText($env:CODEX_PROCESS_EXEC_PROBE_FILE, 'process'); ", + "[IO.File]::WriteAllText($env:CODEX_PROCESS_EXEC_PROBE_FILE, ''); ", "while (!(Test-Path -LiteralPath $env:CODEX_PROCESS_EXEC_RELEASE_FILE)) { ", "Start-Sleep -Milliseconds 20 ", "}; ", @@ -52,7 +52,7 @@ async fn process_spawn_returns_before_exit_and_emits_exit_notification() -> Resu "sh".to_string(), "-c".to_string(), concat!( - "printf process > \"$CODEX_PROCESS_EXEC_PROBE_FILE\"; ", + ": > \"$CODEX_PROCESS_EXEC_PROBE_FILE\"; ", "while [ ! -e \"$CODEX_PROCESS_EXEC_RELEASE_FILE\" ]; do sleep 0.05; done; ", "printf 'process-out|%s|%s' \"$OpenAI_Federation_Rule_Id\" \"$OPENAI_IDENTITY_TOKEN_FILE\"; ", "printf process-err >&2", @@ -93,7 +93,6 @@ async fn process_spawn_returns_before_exit_and_emits_exit_notification() -> Resu assert_eq!(response.result, serde_json::json!({})); wait_for_file(&probe_file).await?; - assert_eq!(std::fs::read_to_string(&probe_file)?, "process"); std::fs::write(&release_file, "release")?; let exited = read_process_exited(&mut mcp).await?; diff --git a/codex-rs/login/tests/suite/login_server_e2e.rs b/codex-rs/login/tests/suite/login_server_e2e.rs index d53d066136..13195803df 100644 --- a/codex-rs/login/tests/suite/login_server_e2e.rs +++ b/codex-rs/login/tests/suite/login_server_e2e.rs @@ -658,9 +658,10 @@ async fn falls_back_to_registered_fallback_port_when_default_port_is_in_use() -> let actual_port = server.actual_port; let auth_url = server.auth_url.clone(); server.cancel(); - let _ = tokio::time::timeout(Duration::from_secs(2), server.block_until_done()) + server + .block_until_done() .await - .expect("login server should shut down after cancel"); + .expect_err("cancelling the fallback login should not report success"); assert_eq!(actual_port, FALLBACK_LOGIN_PORT); assert!(auth_url.contains(&format!(