This commit is contained in:
Mateusz Gruszczyński committed 2026-10-05 10:58:50 +02:00
1 parent c819f0a335
commit e1a59f6e56
53 files changed
+817 -380

No files matched your search

+24
View File
@@ -72,6 +72,30 @@ fn legacy_settings_without_passive_health_default_to_off() {
assert!(parsed.retry.retry_connect_errors);
assert!(parsed.retry.retry_timeouts);
assert_eq!(parsed.retry.retry_statuses, vec![502, 503, 504]);
assert_eq!(parsed.keepalive.pool_recycle_requests, 25_000);
assert_eq!(parsed.keepalive.pool_recycle_seconds, 3_600);
assert_eq!(parsed.keepalive.http1_max_buffer_bytes, 131_072);
}
#[test]
fn upstream_pool_recycle_limits_are_bounded_and_can_be_disabled() {
let mut settings = Settings::default();
assert!(settings.validate().is_ok());
settings.keepalive.pool_recycle_requests = 0;
settings.keepalive.pool_recycle_seconds = 0;
assert!(settings.validate().is_ok());
settings.keepalive.pool_recycle_requests = 999;
assert!(settings.validate().is_err());
settings.keepalive.pool_recycle_requests = 1_000;
settings.keepalive.pool_recycle_seconds = 59;
assert!(settings.validate().is_err());
settings.keepalive.pool_recycle_seconds = 60;
settings.keepalive.http1_max_buffer_bytes = 8_191;
assert!(settings.validate().is_err());
settings.keepalive.http1_max_buffer_bytes = 8_192;
assert!(settings.validate().is_ok());
}
#[test]