Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"targeted_mechanism": "none",
"kind": "harness",
"slice_class": "non_ranking",
"fixtures": [
"harness-goldens"
]
}
17 changes: 8 additions & 9 deletions crates/aft/src/subc/consent_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion scripts/file-size-pins.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Loading