Skip to content

Commit b003bdb

Browse files
k0kubuneregon
authored andcommitted
Retry IO.select with a longer timeout on flaky platforms (#16542)
On MinGW (Windows), pipe readiness after syswrite may not be immediately visible to IO.select with timeout 0, causing a spurious nil return. Retry with a longer timeout to handle this. https://github.com/ruby/ruby/actions/runs/23519269557/job/68458831324?pr=16262
1 parent 51821a6 commit b003bdb

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

core/io/select_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
@wr.syswrite("be ready")
1919
IO.pipe do |_, wr|
2020
result = IO.select [@rd], [wr], nil, 0
21+
unless result
22+
# On some platforms (e.g., Windows), pipe readiness may not be immediate
23+
result = IO.select [@rd], [wr], nil, 2
24+
end
2125
result.should == [[@rd], [wr], []]
2226
end
2327
end

0 commit comments

Comments
 (0)