Skip to content

Commit dd32ec3

Browse files
committed
Fix race condition in TestIOWait#test_wait
Replace `sleep 0.1` with `IO.select([@r])` to reliably wait for data to arrive before asserting readability with a zero timeout. The fixed sleep was insufficient on slow Windows CI runners, causing sporadic failures. This matches the approach already used in test_wait_readable.
1 parent 7c3806b commit dd32ec3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

test/io/wait/test_io_wait.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_wait
2323
omit 'unstable on MinGW' if /mingw/ =~ RUBY_PLATFORM
2424
assert_nil @r.wait(0)
2525
@w.syswrite "."
26-
sleep 0.1
26+
IO.select([@r])
2727
assert_equal @r, @r.wait(0)
2828
end
2929

0 commit comments

Comments
 (0)