diff --git a/codex-rs/core/tests/common/test_codex.rs b/codex-rs/core/tests/common/test_codex.rs index 31f3176574..02171c9709 100644 --- a/codex-rs/core/tests/common/test_codex.rs +++ b/codex-rs/core/tests/common/test_codex.rs @@ -722,12 +722,6 @@ impl TestCodex { personality: None, }) .await?; - wait_for_event_with_timeout( - &self.codex, - |event| matches!(event, EventMsg::TurnStarted(_)), - SUBMIT_TURN_COMPLETE_TIMEOUT, - ) - .await; Ok(()) } diff --git a/codex-rs/core/tests/suite/compact_resume_fork.rs b/codex-rs/core/tests/suite/compact_resume_fork.rs index da2f7bd74f..2788c8ef21 100644 --- a/codex-rs/core/tests/suite/compact_resume_fork.rs +++ b/codex-rs/core/tests/suite/compact_resume_fork.rs @@ -35,18 +35,15 @@ use core_test_support::responses::mount_sse_sequence; use core_test_support::responses::sse; use core_test_support::test_codex::test_codex; use core_test_support::wait_for_event; -use core_test_support::wait_for_event_with_timeout; use pretty_assertions::assert_eq; use serde_json::Value; use serde_json::json; use std::sync::Arc; use tempfile::TempDir; -use tokio::time::Duration; use wiremock::MockServer; const AFTER_SECOND_RESUME: &str = "AFTER_SECOND_RESUME"; const AFTER_ROLLBACK: &str = "AFTER_ROLLBACK"; -const THREAD_ROLLBACK_EVENT_TIMEOUT: Duration = Duration::from_secs(120); fn network_disabled() -> bool { std::env::var(CODEX_SANDBOX_NETWORK_DISABLED_ENV_VAR).is_ok() @@ -458,12 +455,8 @@ async fn snapshot_rollback_past_compaction_replays_append_only_history() -> Resu base.submit(Op::ThreadRollback { num_turns: 1 }) .await .expect("submit thread rollback"); - let rollback_event = wait_for_event_with_timeout( - &base, - |ev| matches!(ev, EventMsg::ThreadRolledBack(_)), - THREAD_ROLLBACK_EVENT_TIMEOUT, - ) - .await; + let rollback_event = + wait_for_event(&base, |ev| matches!(ev, EventMsg::ThreadRolledBack(_))).await; let EventMsg::ThreadRolledBack(rollback_event) = rollback_event else { panic!("expected thread rolled back event"); }; @@ -583,11 +576,9 @@ async fn snapshot_rollback_followup_turn_trims_context_updates() -> Result<()> { conversation .submit(Op::ThreadRollback { num_turns: 1 }) .await?; - let rollback_event = wait_for_event_with_timeout( - &conversation, - |ev| matches!(ev, EventMsg::ThreadRolledBack(_)), - THREAD_ROLLBACK_EVENT_TIMEOUT, - ) + let rollback_event = wait_for_event(&conversation, |ev| { + matches!(ev, EventMsg::ThreadRolledBack(_)) + }) .await; let EventMsg::ThreadRolledBack(rollback_event) = rollback_event else { panic!("expected thread rolled back event"); diff --git a/codex-rs/core/tests/suite/model_switching.rs b/codex-rs/core/tests/suite/model_switching.rs index 55c8de384b..21ab43f10d 100644 --- a/codex-rs/core/tests/suite/model_switching.rs +++ b/codex-rs/core/tests/suite/model_switching.rs @@ -34,15 +34,11 @@ use core_test_support::test_codex::TestCodex; use core_test_support::test_codex::test_codex; use core_test_support::test_codex::turn_permission_fields; use core_test_support::wait_for_event; -use core_test_support::wait_for_event_with_timeout; use pretty_assertions::assert_eq; use std::path::Path; use std::path::PathBuf; -use tokio::time::Duration; use wiremock::MockServer; -const THREAD_ROLLBACK_EVENT_TIMEOUT: Duration = Duration::from_secs(120); - fn read_only_user_turn(test: &TestCodex, items: Vec, model: String) -> Op { let (sandbox_policy, permission_profile) = turn_permission_fields(PermissionProfile::read_only(), test.cwd_path()); @@ -798,11 +794,9 @@ async fn thread_rollback_after_generated_image_drops_entire_image_turn_history() test.codex .submit(Op::ThreadRollback { num_turns: 1 }) .await?; - wait_for_event_with_timeout( - &test.codex, - |ev| matches!(ev, EventMsg::ThreadRolledBack(_)), - THREAD_ROLLBACK_EVENT_TIMEOUT, - ) + wait_for_event(&test.codex, |ev| { + matches!(ev, EventMsg::ThreadRolledBack(_)) + }) .await; test.codex