Skip to content

Commit

Permalink
net: fix the uds_datagram tests with the latest nightly stdlib (#3952)
Browse files Browse the repository at this point in the history
  • Loading branch information
asomers authored and hawkw committed Nov 16, 2021
1 parent e2e7b5e commit ea87e4e
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions tokio/tests/uds_datagram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,12 @@ async fn try_send_recv_never_block() -> io::Result<()> {
dgram1.writable().await.unwrap();

match dgram1.try_send(payload) {
Err(err) => match err.kind() {
io::ErrorKind::WouldBlock | io::ErrorKind::Other => break,
_ => unreachable!("unexpected error {:?}", err),
Err(err) => match (err.kind(), err.raw_os_error()) {
(io::ErrorKind::WouldBlock, _) => break,
(_, Some(libc::ENOBUFS)) => break,
_ => {
panic!("unexpected error {:?}", err);
}
},
Ok(len) => {
assert_eq!(len, payload.len());
Expand Down Expand Up @@ -291,9 +294,12 @@ async fn try_recv_buf_never_block() -> io::Result<()> {
dgram1.writable().await.unwrap();

match dgram1.try_send(payload) {
Err(err) => match err.kind() {
io::ErrorKind::WouldBlock | io::ErrorKind::Other => break,
_ => unreachable!("unexpected error {:?}", err),
Err(err) => match (err.kind(), err.raw_os_error()) {
(io::ErrorKind::WouldBlock, _) => break,
(_, Some(libc::ENOBUFS)) => break,
_ => {
panic!("unexpected error {:?}", err);
}
},
Ok(len) => {
assert_eq!(len, payload.len());
Expand Down

0 comments on commit ea87e4e

Please sign in to comment.