From 9ae606cfc1b7eeda7b08a4763b9f1b8dff96bb45 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Wed, 8 Apr 2026 12:51:34 -0400 Subject: [PATCH] fix(test): use no_proxy client in detach signal test to prevent macOS timeout flakes Co-Authored-By: Claude Opus 4.6 (1M context) --- lib/crates/fabro-cli/src/commands/run/attach.rs | 5 +---- lib/crates/fabro-cli/src/server_client.rs | 12 ++++++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/crates/fabro-cli/src/commands/run/attach.rs b/lib/crates/fabro-cli/src/commands/run/attach.rs index 9ebb1eb9c..417cf80b6 100644 --- a/lib/crates/fabro-cli/src/commands/run/attach.rs +++ b/lib/crates/fabro-cli/src/commands/run/attach.rs @@ -580,10 +580,7 @@ mod tests { .header("Content-Type", "application/json") .body(terminal_run_state_response().to_string()); }); - let client = - server_client::connect_server_target_direct(&format!("{}/api/v1", server.base_url())) - .await - .unwrap(); + let client = server_client::ServerStoreClient::new_no_proxy(&server.base_url()).unwrap(); handle_detach_signal(&client, &run_id, true).await; diff --git a/lib/crates/fabro-cli/src/server_client.rs b/lib/crates/fabro-cli/src/server_client.rs index 4e8234dbd..14b86167e 100644 --- a/lib/crates/fabro-cli/src/server_client.rs +++ b/lib/crates/fabro-cli/src/server_client.rs @@ -272,6 +272,18 @@ struct ArtifactBatchUploadEntry { } impl ServerStoreClient { + /// Build a client for tests that bypasses proxy discovery. + #[cfg(test)] + pub(crate) fn new_no_proxy(base_url: &str) -> Result { + let http_client = cli_http_client_builder().no_proxy().build()?; + let client = fabro_api::Client::new_with_client(base_url, http_client.clone()); + Ok(Self { + client, + http_client, + base_url: base_url.to_string(), + }) + } + pub(crate) fn clone_for_reuse(&self) -> Self { self.clone() }