Fix test for single-endpoint DC

This commit is contained in:
Alexey
2026-04-12 10:38:22 +03:00
parent 69a73d5fec
commit 16c7a63fbc

View File

@@ -109,18 +109,16 @@ async fn connectable_endpoints_waits_until_quarantine_expires() {
{ {
let mut guard = pool.endpoint_quarantine.lock().await; let mut guard = pool.endpoint_quarantine.lock().await;
guard.insert(addr, Instant::now() + Duration::from_millis(80)); guard.insert(addr, Instant::now() + Duration::from_millis(500));
} }
let started = Instant::now(); let endpoints = tokio::time::timeout(
let endpoints = pool.connectable_endpoints_for_test(&[addr]).await; Duration::from_millis(120),
let elapsed = started.elapsed(); pool.connectable_endpoints_for_test(&[addr]),
)
.await
.expect("single-endpoint outage mode should bypass quarantine delay");
assert_eq!(endpoints, vec![addr]); assert_eq!(endpoints, vec![addr]);
assert!(
elapsed >= Duration::from_millis(50),
"single-endpoint DC should honor quarantine before retry"
);
} }
#[tokio::test] #[tokio::test]