From abf3f50bb990528a3fd2c19a3a358c82d0b22266 Mon Sep 17 00:00:00 2001 From: Nahor Date: Sun, 19 Oct 2025 14:55:37 -0700 Subject: [PATCH] Relax test `test_dup2_during_select_ebadf` (#11976) On MSYS/Cygwin, when select/poll wait on a descriptor and `dup2` is used to copy into that descriptor, they return the descriptor as "ready", unlike Linux (timeout) and MacOS (EBADF error). The test specifically checked for Linux and MaxOS behaviors, failing on Cygwin/MSYS. So relax it to also allow that behavior. --- src/tests/fd_monitor.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests/fd_monitor.rs b/src/tests/fd_monitor.rs index 0e94f3a94..f9b423cb5 100644 --- a/src/tests/fd_monitor.rs +++ b/src/tests/fd_monitor.rs @@ -232,8 +232,8 @@ fn test_dup2_during_select_ebadf() { }; let result = do_something_bad_during_select(dup2_it); assert!( - matches!(result, Err(libc::EBADF) | Ok(0)), - "select/poll should have failed with EBADF or timed out" + matches!(result, Err(libc::EBADF) | Ok(0) | Ok(1)), + "select/poll should have failed with EBADF or timed out or the fd should be ready" ); // Ensure these stay alive until after thread is joined. drop(pipe_read);