mirror of
https://github.com/telemt/telemt.git
synced 2026-05-01 17:34:09 +03:00
Bounded ME Route fairness and IP-Cleanup-Backlog
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com> Signed-off-by: Alexey <247128645+axkurcom@users.noreply.github.com>
This commit is contained in:
@@ -649,6 +649,25 @@ async fn duplicate_cleanup_entries_do_not_break_future_admission() {
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn duplicate_cleanup_entries_are_coalesced_until_drain() {
|
||||
let tracker = UserIpTracker::new();
|
||||
let ip = ip_from_idx(7150);
|
||||
|
||||
tracker.enqueue_cleanup("coalesced-cleanup".to_string(), ip);
|
||||
tracker.enqueue_cleanup("coalesced-cleanup".to_string(), ip);
|
||||
tracker.enqueue_cleanup("coalesced-cleanup".to_string(), ip);
|
||||
|
||||
assert_eq!(
|
||||
tracker.cleanup_queue_len_for_tests(),
|
||||
1,
|
||||
"duplicate queued cleanup entries must retain one allocation slot"
|
||||
);
|
||||
|
||||
tracker.drain_cleanup_queue().await;
|
||||
assert_eq!(tracker.cleanup_queue_len_for_tests(), 0);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn stress_repeated_queue_poison_recovery_preserves_admission_progress() {
|
||||
let tracker = UserIpTracker::new();
|
||||
|
||||
Reference in New Issue
Block a user