fix uds_stream::epollhup test

This commit is contained in:
Eliza Weisman
2024-08-12 13:22:03 -07:00
parent 38cc55b338
commit 1064b29f94
+11 -1
View File
@@ -406,6 +406,16 @@ async fn epollhup() -> io::Result<()> {
drop(listener);
let err = connect.await.unwrap_err();
assert_eq!(err.kind(), io::ErrorKind::ConnectionReset);
// On illumos (and presumably other Solaris descendents), `connect(3SOCKET)`
// returns `ECONNREFUSED` here rather than `ECONNRESET`.
//
// See: https://illumos.org/man/3SOCKET/connect
let expected_errno = if cfg!(target_os = "illumos") || cfg!(target_os = "solaris") {
io::ErrorKind::ConnectionRefused
} else {
io::ErrorKind::ConnectionReset
};
assert_eq!(err.kind(), expected_errno);
Ok(())
}