Fix recvmmsg test for timeout
This commit is contained in:
parent
e104941569
commit
aa1bd603e6
|
@ -145,7 +145,7 @@ mod tests {
|
|||
reader.set_nonblocking(false).unwrap();
|
||||
let sender = UdpSocket::bind("127.0.0.1:0").expect("bind");
|
||||
let saddr = sender.local_addr().unwrap();
|
||||
let sent = NUM_RCVMMSGS + 10;
|
||||
let sent = NUM_RCVMMSGS;
|
||||
for _ in 0..sent {
|
||||
let data = [0; PACKET_DATA_SIZE];
|
||||
sender.send_to(&data[..], &addr).unwrap();
|
||||
|
@ -160,12 +160,7 @@ mod tests {
|
|||
assert_eq!(packets[i].meta.addr(), saddr);
|
||||
}
|
||||
|
||||
let recv = recv_mmsg(&reader, &mut packets[..]).unwrap();
|
||||
assert_eq!(sent - NUM_RCVMMSGS, recv);
|
||||
for i in 0..recv {
|
||||
assert_eq!(packets[i].meta.size, PACKET_DATA_SIZE);
|
||||
assert_eq!(packets[i].meta.addr(), saddr);
|
||||
}
|
||||
let _recv = recv_mmsg(&reader, &mut packets[..]);
|
||||
assert!(start.elapsed().as_secs() < 5);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue