mirror of
https://github.com/telemt/telemt.git
synced 2026-04-15 01:24:09 +03:00
Fix test for single-endpoint DC
This commit is contained in:
@@ -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]
|
||||||
|
|||||||
Reference in New Issue
Block a user