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
|
socket
|
||||||
.set_read_timeout(Some(Duration::from_millis(250)))
|
.set_read_timeout(Some(Duration::from_millis(250)))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
while let Some((packet, _)) = recv_request_timeout(&socket) {
|
if let Some((packet, _)) = recv_request_timeout(&socket) {
|
||||||
assert_eq!(
|
panic!(
|
||||||
packet[3] & flags::FLAG_CLOSE,
|
"session cleanup must not send any packet after peer close; flags={:?} len={}",
|
||||||
0,
|
packet.get(3).copied(),
|
||||||
"session cleanup must not send a close after peer close"
|
packet.len()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -532,11 +532,11 @@ mod tests {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
while let Some((packet, _)) = recv_request_timeout(&socket) {
|
if let Some((packet, _)) = recv_request_timeout(&socket) {
|
||||||
assert_eq!(
|
panic!(
|
||||||
packet[3] & flags::FLAG_CLOSE,
|
"managed cleanup must not send any packet after peer close; flags={:?} len={}",
|
||||||
0,
|
packet.get(3).copied(),
|
||||||
"managed cleanup must not send a close after peer close"
|
packet.len()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user