From 86fe4f6be4a57708ff00117a4324fe2f14503de3 Mon Sep 17 00:00:00 2001 From: Friel Date: Sun, 8 Mar 2026 22:59:43 -0700 Subject: [PATCH] test(app-server): stabilize thread unsubscribe on slow runners --- codex-rs/app-server/tests/suite/v2/thread_unsubscribe.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/codex-rs/app-server/tests/suite/v2/thread_unsubscribe.rs b/codex-rs/app-server/tests/suite/v2/thread_unsubscribe.rs index 5808f0fe79..8616bccae6 100644 --- a/codex-rs/app-server/tests/suite/v2/thread_unsubscribe.rs +++ b/codex-rs/app-server/tests/suite/v2/thread_unsubscribe.rs @@ -192,6 +192,10 @@ async fn thread_unsubscribe_during_turn_interrupts_turn_and_emits_thread_closed( wait_for_command_execution_item_started(&mut mcp), ) .await??; + // `item/started` can arrive before the spawned command reports a process id. + // Give the runtime a brief moment to finish wiring the command so unsubscribe + // consistently exercises the shutdown path on slower CI runners. + tokio::time::sleep(std::time::Duration::from_millis(250)).await; let unsubscribe_id = mcp .send_thread_unsubscribe_request(ThreadUnsubscribeParams {