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.
This commit is contained in:
Nahor
2025-10-19 14:55:37 -07:00
committed by Johannes Altmanninger
parent 20a6ac947b
commit abf3f50bb9

View File

@@ -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);