feat(tests,client): add flow control and load test coverage and honor configured keepalive intervals

This commit is contained in:
2026-03-17 19:15:43 +00:00
parent 835f0f791d
commit eb30825f72
5 changed files with 645 additions and 3 deletions

View File

@@ -167,8 +167,15 @@ impl VpnClient {
info!("Connected to VPN, assigned IP: {}", assigned_ip);
// Create adaptive keepalive monitor
let (monitor, handle) = keepalive::create_keepalive(None);
// Create adaptive keepalive monitor (use custom interval if configured)
let ka_config = config.keepalive_interval_secs.map(|secs| {
let mut cfg = keepalive::AdaptiveKeepaliveConfig::default();
cfg.degraded_interval = std::time::Duration::from_secs(secs);
cfg.healthy_interval = std::time::Duration::from_secs(secs * 2);
cfg.critical_interval = std::time::Duration::from_secs((secs / 3).max(1));
cfg
});
let (monitor, handle) = keepalive::create_keepalive(ka_config);
self.quality_rx = Some(handle.quality_rx);
// Spawn the keepalive monitor