Skip to content

Commit 97662c0

Browse files
BerrysoftThomasdezeeuw
authored andcommitted
add ignore reasons
1 parent 1219a3d commit 97662c0

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

tests/unix_listener.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ fn unix_listener_register() {
8989
}
9090

9191
#[test]
92-
#[cfg_attr(target_os = "cygwin", ignore)]
92+
#[cfg_attr(target_os = "cygwin", ignore = "Cygwin blocks on connect")]
9393
fn unix_listener_reregister() {
9494
let (mut poll, mut events) = init_with_poll();
9595
let barrier = Arc::new(Barrier::new(2));
@@ -117,7 +117,7 @@ fn unix_listener_reregister() {
117117
}
118118

119119
#[test]
120-
#[cfg_attr(target_os = "cygwin", ignore)]
120+
#[cfg_attr(target_os = "cygwin", ignore = "Cygwin blocks on connect")]
121121
fn unix_listener_deregister() {
122122
let (mut poll, mut events) = init_with_poll();
123123
let barrier = Arc::new(Barrier::new(2));

tests/unix_stream.rs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,12 @@ fn unix_stream_send_and_sync() {
3737
target_os = "hurd",
3838
ignore = "getting pathname isn't supported on GNU/Hurd"
3939
)]
40-
#[cfg_attr(target_os = "cygwin", ignore)]
4140
fn unix_stream_smoke() {
4241
#[allow(clippy::redundant_closure)]
4342
smoke_test(|path| UnixStream::connect(path), "unix_stream_smoke");
4443
}
4544

4645
#[test]
47-
#[cfg_attr(target_os = "cygwin", ignore)]
4846
fn unix_stream_connect() {
4947
let (mut poll, mut events) = init_with_poll();
5048
let barrier = Arc::new(Barrier::new(2));
@@ -88,7 +86,6 @@ fn unix_stream_connect() {
8886
target_os = "hurd",
8987
ignore = "getting pathname isn't supported on GNU/Hurd"
9088
)]
91-
#[cfg_attr(target_os = "cygwin", ignore)]
9289
fn unix_stream_connect_addr() {
9390
let (mut poll, mut events) = init_with_poll();
9491
let barrier = Arc::new(Barrier::new(2));
@@ -135,7 +132,6 @@ fn unix_stream_connect_addr() {
135132
target_os = "hurd",
136133
ignore = "getting pathname isn't supported on GNU/Hurd"
137134
)]
138-
#[cfg_attr(target_os = "cygwin", ignore)]
139135
fn unix_stream_from_std() {
140136
smoke_test(
141137
|path| {
@@ -187,7 +183,7 @@ fn unix_stream_pair() {
187183
target_os = "hurd",
188184
ignore = "getting pathname isn't supported on GNU/Hurd"
189185
)]
190-
#[cfg_attr(target_os = "cygwin", ignore)]
186+
#[cfg_attr(target_os = "cygwin", ignore = "nonblocking connect doesn't handshake")]
191187
fn unix_stream_peer_addr() {
192188
init();
193189
let (handle, expected_addr) = new_echo_listener(1, "unix_stream_peer_addr");
@@ -272,7 +268,6 @@ fn unix_stream_shutdown_read() {
272268
target_os = "hurd",
273269
ignore = "getting pathname isn't supported on GNU/Hurd"
274270
)]
275-
#[cfg_attr(target_os = "cygwin", ignore)]
276271
fn unix_stream_shutdown_write() {
277272
let (mut poll, mut events) = init_with_poll();
278273
let (handle, remote_addr) = new_echo_listener(1, "unix_stream_shutdown_write");
@@ -335,7 +330,6 @@ fn unix_stream_shutdown_write() {
335330
target_os = "hurd",
336331
ignore = "getting pathname isn't supported on GNU/Hurd"
337332
)]
338-
#[cfg_attr(target_os = "cygwin", ignore)]
339333
fn unix_stream_shutdown_both() {
340334
let (mut poll, mut events) = init_with_poll();
341335
let (handle, remote_addr) = new_echo_listener(1, "unix_stream_shutdown_both");
@@ -364,7 +358,7 @@ fn unix_stream_shutdown_both() {
364358

365359
stream.shutdown(Shutdown::Both).unwrap();
366360
// Solaris never returns POLLHUP for sockets.
367-
#[cfg(not(target_os = "solaris"))]
361+
#[cfg(not(any(target_os = "solaris", target_os = "cygwin")))]
368362
expect_events(
369363
&mut poll,
370364
&mut events,
@@ -442,7 +436,6 @@ fn unix_stream_shutdown_listener_write() {
442436
target_os = "hurd",
443437
ignore = "getting pathname isn't supported on GNU/Hurd"
444438
)]
445-
#[cfg_attr(target_os = "cygwin", ignore)]
446439
fn unix_stream_register() {
447440
let (mut poll, mut events) = init_with_poll();
448441
let (handle, remote_addr) = new_echo_listener(1, "unix_stream_register");
@@ -464,7 +457,6 @@ fn unix_stream_register() {
464457
target_os = "hurd",
465458
ignore = "getting pathname isn't supported on GNU/Hurd"
466459
)]
467-
#[cfg_attr(target_os = "cygwin", ignore)]
468460
fn unix_stream_reregister() {
469461
let (mut poll, mut events) = init_with_poll();
470462
let (handle, remote_addr) = new_echo_listener(1, "unix_stream_reregister");
@@ -493,7 +485,7 @@ fn unix_stream_reregister() {
493485
target_os = "hurd",
494486
ignore = "getting pathname isn't supported on GNU/Hurd"
495487
)]
496-
#[cfg_attr(target_os = "cygwin", ignore)]
488+
#[cfg_attr(target_os = "cygwin", ignore = "nonblocking connect doesn't handshake")]
497489
fn unix_stream_deregister() {
498490
let (mut poll, mut events) = init_with_poll();
499491
let (handle, remote_addr) = new_echo_listener(1, "unix_stream_deregister");
@@ -605,7 +597,14 @@ fn new_echo_listener(
605597
amount
606598
}
607599
Err(ref err) if err.kind() == io::ErrorKind::WouldBlock => continue,
608-
Err(ref err) if err.kind() == io::ErrorKind::ConnectionReset => break,
600+
Err(ref err)
601+
if matches!(
602+
err.kind(),
603+
io::ErrorKind::ConnectionReset | io::ErrorKind::ConnectionAborted
604+
) =>
605+
{
606+
break
607+
}
609608
Err(err) => panic!("{}", err),
610609
};
611610
if n == 0 {

0 commit comments

Comments
 (0)