mirror of
https://github.com/rustdesk/rustdesk-server.git
synced 2026-10-12 03:34:26 +00:00
test(hbbs): assert which punch-request records survive eviction
The length check alone passed if the newest record were evicted or new records were dropped once full. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PkpVy2ufxgEjKd3SjXPnJ8
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
b0a07de9be
commit
d75a9aad92
@@ -1442,5 +1442,9 @@ mod tests {
|
|||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
assert_eq!(PUNCH_REQS.lock().await.len(), *PUNCH_REQ_MAX);
|
assert_eq!(PUNCH_REQS.lock().await.len(), *PUNCH_REQ_MAX);
|
||||||
|
// the oldest half is evicted and the newest kept
|
||||||
|
let lock = PUNCH_REQS.lock().await;
|
||||||
|
assert_eq!(lock.front().unwrap().to_id, format!("peer{}", *PUNCH_REQ_MAX % 31));
|
||||||
|
assert_eq!(lock.back().unwrap().to_id, format!("peer{}", (*PUNCH_REQ_MAX * 2 - 1) % 31));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user