From bb726cdb6334d5f69451266773aea346959610bf Mon Sep 17 00:00:00 2001 From: ualtinok <94532+ualtinok@users.noreply.github.com> Date: Sun, 22 Nov 2026 15:02:24 +0100 Subject: [PATCH 1/2] Make the deferred-search test's embedder stream blocking on macOS On macOS an accepted socket inherits O_NONBLOCK from a nonblocking listener, so the fake embedding server's first read could fail with WouldBlock before AFT's request arrived. That failed main's macOS integration shard after the 0.67.0 version bump. Search-quality descriptor: no ranking change. Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com> --- .../ci-speed-macos-embedder-blocking.json | 8 ++++++++ .../tests/integration/standalone_search_deferred_test.rs | 6 ++++++ 2 files changed, 14 insertions(+) create mode 100644 benchmarks/aft-search/slice-descriptors/ci-speed-macos-embedder-blocking.json diff --git a/benchmarks/aft-search/slice-descriptors/ci-speed-macos-embedder-blocking.json b/benchmarks/aft-search/slice-descriptors/ci-speed-macos-embedder-blocking.json new file mode 100644 index 0000000000..ebd574711e --- /dev/null +++ b/benchmarks/aft-search/slice-descriptors/ci-speed-macos-embedder-blocking.json @@ -0,0 +1,8 @@ +{ + "targeted_mechanism": "none", + "kind": "harness", + "slice_class": "non_ranking", + "fixtures": [ + "harness-goldens" + ] +} diff --git a/crates/aft/tests/integration/standalone_search_deferred_test.rs b/crates/aft/tests/integration/standalone_search_deferred_test.rs index 68203e990f..cb8186da00 100644 --- a/crates/aft/tests/integration/standalone_search_deferred_test.rs +++ b/crates/aft/tests/integration/standalone_search_deferred_test.rs @@ -157,6 +157,12 @@ fn standalone_configure_replays_completed_task_before_queued_completion_drain() } fn read_http_request(stream: &mut TcpStream) -> String { + // On macOS an accepted socket inherits O_NONBLOCK from a nonblocking + // listener, so a read before the request arrives fails with WouldBlock + // instead of waiting. Make the timeout below the only limit. + stream + .set_nonblocking(false) + .expect("make embedding stream blocking"); stream .set_read_timeout(Some(Duration::from_secs(2))) .expect("set embedding read timeout"); From 40de546307c77b696507340fb081fb1d47f08164 Mon Sep 17 00:00:00 2001 From: ualtinok <94532+ualtinok@users.noreply.github.com> Date: Sun, 22 Nov 2026 16:11:39 +0100 Subject: [PATCH 2/2] Give the consent route-close test's non-timeout calls a 30 s deadline The test used one 100 ms deadline for all three calls. On the busy macOS CI machine, opening the route alone took longer, so the first call failed with 'call deadline elapsed before request was sent'. Only the timeout case needs the short deadline. Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com> --- crates/aft/src/subc/consent_tests.rs | 17 ++++++++--------- scripts/file-size-pins.json | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/crates/aft/src/subc/consent_tests.rs b/crates/aft/src/subc/consent_tests.rs index 4cb62de3fc..0b90d92c1d 100644 --- a/crates/aft/src/subc/consent_tests.rs +++ b/crates/aft/src/subc/consent_tests.rs @@ -7663,30 +7663,29 @@ async fn consent_completed_and_failed_calls_close_scoped_routes() { ); let transport = Arc::new(SubcConsentTransport::new(daemon.path.clone())); *transport.consumer.lock().await = Some(Arc::clone(&consumer)); - let call = |method| ConsentCall { + let call = |method, timeout_ms| ConsentCall { scope: selector(&stamp("worker", "worker", Some("head"))), project_root: PathBuf::from("/project"), session: "consent-close".into(), method, params: json!({}), - timeout: Duration::from_millis(100), + timeout: Duration::from_millis(timeout_ms), }; + // Only the timeout case uses a short deadline: on a busy CI machine, + // opening the route alone can take longer than 100 ms. + let send = |method, timeout_ms| transport.clone().send(call(method, timeout_ms)); assert_eq!( - transport - .clone() - .send(call("consent.request")) - .await - .unwrap(), + send("consent.request", 30_000).await.unwrap(), json!({"ok":true}) ); daemon.wait_closed(); assert!(matches!( - transport.clone().send(call("consent.test_error")).await, + send("consent.test_error", 30_000).await, Err(ConsentError::Refused { .. }) )); daemon.wait_closed(); assert!(matches!( - transport.clone().send(call("consent.test_timeout")).await, + send("consent.test_timeout", 100).await, Err(ConsentError::Unavailable(_)) )); daemon.wait_closed(); diff --git a/scripts/file-size-pins.json b/scripts/file-size-pins.json index 37de714911..f77256c181 100644 --- a/scripts/file-size-pins.json +++ b/scripts/file-size-pins.json @@ -44,7 +44,7 @@ "reason": "Split GitHub shim policy and commands pending; AFT crate split lane." }, "crates/aft/src/subc/consent_tests.rs": { - "lines": 8497, + "lines": 8496, "reason": "Split consent tests by policy scenario pending; AFT crate split lane." }, "crates/aft/tests/integration/inspect_command_test.rs": {