From 855c0f1d6766cb1e9e0e693da2a4d0ce0cf48c05 Mon Sep 17 00:00:00 2001 From: "glm-5.1" Date: Fri, 12 Jun 2026 14:28:19 +0000 Subject: [PATCH] fix(rename-misleading-test): rename misleading test and use from_sites in dynamic config test --- tests/integration_test.rs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/integration_test.rs b/tests/integration_test.rs index d42ec74..4c7080b 100644 --- a/tests/integration_test.rs +++ b/tests/integration_test.rs @@ -79,7 +79,7 @@ async fn test_health_check_local_port_binds_localhost() { } #[tokio::test] -async fn test_health_check_disabled_when_port_zero() { +async fn test_health_check_binds_random_port_when_zero() { let result = reverse_proxy::health::start_health_check_listener(0).await; assert!(result.is_ok()); let (addr, handle) = result.unwrap(); @@ -612,21 +612,21 @@ fn test_validate_wildcard_bind_via_cli_flag() { } fn test_dynamic_config_with_limit(limit_bytes: u64) -> Arc> { - let config = DynamicConfig { - sites: vec![SiteConfig { - host: "test.local".to_string(), - upstream: "127.0.0.1:8080".to_string(), - upstream_scheme: "http".to_string(), - upstream_connect_timeout_secs: 5, - upstream_request_timeout_secs: 60, - }], - rate_limit: RateLimitConfig { + let sites = vec![SiteConfig { + host: "test.local".to_string(), + upstream: "127.0.0.1:8080".to_string(), + upstream_scheme: "http".to_string(), + upstream_connect_timeout_secs: 5, + upstream_request_timeout_secs: 60, + }]; + let config = DynamicConfig::from_sites( + sites, + RateLimitConfig { requests_per_second: 10, burst: 20, }, - body: BodyConfig { limit_bytes }, - routing_table: Default::default(), - }; + BodyConfig { limit_bytes }, + ); Arc::new(ArcSwap::from_pointee(config)) }