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/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/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"); 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": {