diff --git a/codex-rs/app-server/tests/suite/v2/experimental_feature_list.rs b/codex-rs/app-server/tests/suite/v2/experimental_feature_list.rs index 3063830d5a..07bdd0bde1 100644 --- a/codex-rs/app-server/tests/suite/v2/experimental_feature_list.rs +++ b/codex-rs/app-server/tests/suite/v2/experimental_feature_list.rs @@ -24,7 +24,7 @@ use std::collections::BTreeMap; use tempfile::TempDir; use tokio::time::timeout; -const DEFAULT_TIMEOUT: Duration = Duration::from_secs(10); +const DEFAULT_TIMEOUT: Duration = Duration::from_secs(30); #[tokio::test] async fn experimental_feature_list_returns_feature_metadata_with_stage() -> Result<()> { diff --git a/codex-rs/connectors/src/lib.rs b/codex-rs/connectors/src/lib.rs index d7c5fb405c..dea4e57dff 100644 --- a/codex-rs/connectors/src/lib.rs +++ b/codex-rs/connectors/src/lib.rs @@ -419,6 +419,9 @@ mod tests { use std::sync::atomic::AtomicUsize; use std::sync::atomic::Ordering; + static ALL_CONNECTORS_CACHE_TEST_LOCK: LazyLock> = + LazyLock::new(|| tokio::sync::Mutex::new(())); + fn cache_key(id: &str) -> AllConnectorsCacheKey { AllConnectorsCacheKey::new( "https://chatgpt.example".to_string(), @@ -445,6 +448,8 @@ mod tests { #[tokio::test] async fn list_all_connectors_uses_shared_cache() -> anyhow::Result<()> { + let _cache_guard = ALL_CONNECTORS_CACHE_TEST_LOCK.lock().await; + let calls = Arc::new(AtomicUsize::new(0)); let call_counter = Arc::clone(&calls); let key = cache_key("shared"); @@ -483,6 +488,8 @@ mod tests { #[tokio::test] async fn list_all_connectors_merges_and_normalizes_directory_apps() -> anyhow::Result<()> { + let _cache_guard = ALL_CONNECTORS_CACHE_TEST_LOCK.lock().await; + let key = cache_key("merged"); let calls = Arc::new(AtomicUsize::new(0)); let call_counter = Arc::clone(&calls); diff --git a/codex-rs/core/tests/suite/compact_remote.rs b/codex-rs/core/tests/suite/compact_remote.rs index 4b1eaa44d2..e694e198d3 100644 --- a/codex-rs/core/tests/suite/compact_remote.rs +++ b/codex-rs/core/tests/suite/compact_remote.rs @@ -791,7 +791,7 @@ async fn remote_compact_trim_estimate_uses_session_base_instructions() -> Result let override_retained_call_id = "override-retained-call"; let override_trailing_call_id = "override-trailing-call"; let retained_command = "printf retained-shell-output"; - let trailing_command = "printf trailing-shell-output"; + let trailing_command = "printf '%020000d' 0"; let baseline_harness = TestCodexHarness::with_builder( test_codex() @@ -880,9 +880,12 @@ async fn remote_compact_trim_estimate_uses_session_base_instructions() -> Result let baseline_input_tokens = estimate_compact_input_tokens(&baseline_compact_request); let baseline_payload_tokens = estimate_compact_payload_tokens(&baseline_compact_request); - let override_base_instructions = - format!("REMOTE_BASE_INSTRUCTIONS_OVERRIDE {}", "x".repeat(120_000)); - let override_context_window = baseline_payload_tokens.saturating_add(1_000); + let override_base_instructions = format!( + "{}\nREMOTE_BASE_INSTRUCTIONS_OVERRIDE {}", + baseline_compact_request.instructions_text(), + "x".repeat(4_000) + ); + let override_context_window = baseline_payload_tokens.saturating_add(500); let pretrim_override_estimate = baseline_input_tokens.saturating_add(approx_token_count(&override_base_instructions)); assert!(