fix(tests): disable macOS proxy discovery via FABRO_HTTP_PROXY_POLICY

The fabro-http crate's proxy policy mechanism was not being used in
tests. http_api.rs used #[cfg(test)] to call .no_proxy(), but cfg(test)
only applies within the crate being tested — downstream crates like
fabro-workflow and fabro-cli hit the production path with system proxy
discovery, adding ~900ms per reqwest client per process.

- Set FABRO_HTTP_PROXY_POLICY=disabled in .cargo/config.toml so all
  test HTTP clients skip proxy discovery automatically
- Remove dead #[cfg(test)] branch in http_api.rs; it now relies on the
  env var like every other fabro-http consumer
- Remove kind(test) from nextest overrides so timeout budgets apply to
  unit tests too, not just integration tests
- Remove unused SessionCookie import in web_auth.rs

Eliminates all 11 flaky nextest timeouts under parallel load.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bryan Helmkamp 2026-04-13 22:14:51 -04:00
parent 01b1fd13bd
commit e5b7bb1909
4 changed files with 14 additions and 19 deletions

View file

@ -1,2 +1,8 @@
[alias]
t = "test -- --format terse"
[env]
# Disable macOS proxy discovery in tests — without this, every reqwest client
# pays ~900ms of system-proxy lookup overhead per process, which pushes tests
# past the 3s nextest kill threshold under parallel load.
FABRO_HTTP_PROXY_POLICY = "disabled"

View file

@ -4,11 +4,11 @@ slow-timeout = { period = "1s", terminate-after = 3 }
leak-timeout = "500ms"
[[profile.default.overrides]]
filter = "package(fabro-cli) & kind(test)"
filter = "package(fabro-cli)"
slow-timeout = { period = "3s", terminate-after = 4 }
[[profile.default.overrides]]
filter = "package(fabro-server) & kind(test)"
filter = "package(fabro-server)"
slow-timeout = { period = "5s", terminate-after = 4 }
[[profile.default.overrides]]
@ -16,7 +16,7 @@ leak-timeout = "500ms"
slow-timeout = { period = "15s", terminate-after = 4 }
[[profile.default.overrides]]
filter = "package(fabro-workflow) & kind(test)"
filter = "package(fabro-workflow)"
slow-timeout = { period = "2s", terminate-after = 3 }
[[profile.default.overrides]]

View file

@ -19,21 +19,10 @@ pub struct HttpApi {
impl HttpApi {
fn build_client(timeout: AdapterTimeout) -> fabro_http::HttpClient {
#[cfg(test)]
{
fabro_http::HttpClientBuilder::new()
.connect_timeout(Duration::from_secs_f64(timeout.connect))
.no_proxy()
.build()
.expect("LLM HTTP client should build")
}
#[cfg(not(test))]
{
fabro_http::HttpClientBuilder::new()
.connect_timeout(Duration::from_secs_f64(timeout.connect))
.build()
.expect("LLM HTTP client should build")
}
fabro_http::HttpClientBuilder::new()
.connect_timeout(Duration::from_secs_f64(timeout.connect))
.build()
.expect("LLM HTTP client should build")
}
#[must_use]

View file

@ -673,7 +673,7 @@ mod tests {
use serde_json::{Value, json};
use tower::ServiceExt;
use super::{SessionCookie, api_routes, read_private_session, routes};
use super::{api_routes, read_private_session, routes};
use crate::jwt_auth::{AuthMode, ConfiguredAuth};
use crate::server;