mirror of
https://github.com/telemt/telemt.git
synced 2026-11-02 13:52:03 +03:00
WEB Manager Session + Generation Fence tests
This commit is contained in:
@@ -287,7 +287,7 @@ impl MePool {
|
||||
}
|
||||
|
||||
/// Evaluates full writer-floor coverage independently for every DC and address family.
|
||||
pub(super) fn hardswap_coverage(
|
||||
pub(in crate::transport::middle_proxy) fn hardswap_coverage(
|
||||
&self,
|
||||
desired_by_dc: &HashMap<i32, HashSet<SocketAddr>>,
|
||||
writer_addrs: &[(i32, SocketAddr)],
|
||||
|
||||
@@ -537,7 +537,12 @@ async fn generation_role_reconciliation_promotes_active_warm_and_drains_orphans(
|
||||
assert!(orphan_warm.draining.load(Ordering::Acquire));
|
||||
assert!(!orphan_warm.allow_drain_fallback.load(Ordering::Acquire));
|
||||
let snapshot = pool.api_hardswap_snapshot().await;
|
||||
let desired = pool.desired_dc_endpoints().await;
|
||||
let coverage = pool.hardswap_coverage(&desired, &[(1, endpoint)]);
|
||||
assert_eq!(snapshot.orphan_warm_writers_current, 0);
|
||||
assert_eq!(snapshot.pending_writer_deficit, 2);
|
||||
assert_eq!(snapshot.pending_missing_dc_groups, 1);
|
||||
assert_eq!(snapshot.pending_writer_deficit, coverage.writer_deficit);
|
||||
assert_eq!(
|
||||
snapshot.pending_missing_dc_groups,
|
||||
coverage.missing_groups.len()
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user