From 15a764d87a92a0abdb9d297465faf228572a04e1 Mon Sep 17 00:00:00 2001 From: Levi Neuwirth Date: Wed, 10 Jun 2026 12:03:44 -0400 Subject: [PATCH] test: widen m9_2 cancel-race harvest margin (macOS CI flake) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fake server sleeps 250ms before responding; a 350ms total budget left 100ms for two pipe transits + thread scheduling, which flaked on loaded macOS runners — and the queued-stdin-writer hop added by the typing-perf arc narrows it further. The contract under test is cancel-after-queue-before-manager-tick, which any long-enough-for-the-response wait preserves. Co-Authored-By: Claude Fable 5 --- tests/m9_2_acceptance.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/m9_2_acceptance.rs b/tests/m9_2_acceptance.rs index 2e98b16..b509f0d 100644 --- a/tests/m9_2_acceptance.rs +++ b/tests/m9_2_acceptance.rs @@ -536,10 +536,15 @@ fn m9_2_cancelled_sibling_wins_over_queued_response() { .read_resource(sid, "file:///race") .expect("read c"); - // Let the fake server finish its delayed response, then harvest - // the supervisor event queue without giving McpManager a chance - // to process it yet. - std::thread::sleep(Duration::from_millis(350)); + // Let the fake server finish its delayed response (it sleeps + // 250ms), then harvest the supervisor event queue without giving + // McpManager a chance to process it yet. The margin over the + // fake's delay must absorb two pipe transits plus the request's + // queued-stdin-writer hop under CI load (a 100ms margin flaked on + // macOS runners); a generous wait does not weaken the contract — + // the race under test is cancel-AFTER-queue-BEFORE-manager-tick, + // which holds for any wait long enough for the response to land. + std::thread::sleep(Duration::from_millis(1000)); sup.borrow_mut().tick(); // Cancel only b after the response is queued but before