test(client): strengthen assertions for session cleanup after peer closure
Update tests to ensure no packets at all are sent following a peer-initiated closure, rather than just checking for the absence of the close flag.
This commit is contained in:
1 parent
97dc1b3f8d
commit
c7d03c0358
2 files changed
+10
-10
No files matched your search
@@ -288,11 +288,11 @@ mod tests {
|
||||
socket
|
||||
.set_read_timeout(Some(Duration::from_millis(250)))
|
||||
.unwrap();
|
||||
while let Some((packet, _)) = recv_request_timeout(&socket) {
|
||||
assert_eq!(
|
||||
packet[3] & flags::FLAG_CLOSE,
|
||||
0,
|
||||
"session cleanup must not send a close after peer close"
|
||||
if let Some((packet, _)) = recv_request_timeout(&socket) {
|
||||
panic!(
|
||||
"session cleanup must not send any packet after peer close; flags={:?} len={}",
|
||||
packet.get(3).copied(),
|
||||
packet.len()
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -532,11 +532,11 @@ mod tests {
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
while let Some((packet, _)) = recv_request_timeout(&socket) {
|
||||
assert_eq!(
|
||||
packet[3] & flags::FLAG_CLOSE,
|
||||
0,
|
||||
"managed cleanup must not send a close after peer close"
|
||||
if let Some((packet, _)) = recv_request_timeout(&socket) {
|
||||
panic!(
|
||||
"managed cleanup must not send any packet after peer close; flags={:?} len={}",
|
||||
packet.get(3).copied(),
|
||||
packet.len()
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user