Skip to content

Commit b602ba5

Browse files
Test nonblock IO.
1 parent 786a0e6 commit b602ba5

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

test/fiber/test_io_close.rb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,18 @@ class TestFiberIOClose < Test::Unit::TestCase
66
def with_socket_pair(&block)
77
omit unless defined?(UNIXSocket)
88

9-
UNIXSocket.pair(&block)
9+
UNIXSocket.pair do |r, w|
10+
if RUBY_PLATFORM=~/mswin|mingw/
11+
i.nonblock = true
12+
o.nonblock = true
13+
end
14+
15+
yield r, w
16+
end
1017
end
1118

1219
# Problematic on Windows.
13-
def x_test_io_close_across_fibers
20+
def test_io_close_across_fibers
1421
with_socket_pair do |i, o|
1522
error = nil
1623

@@ -67,7 +74,7 @@ def test_io_close_blocking_thread
6774
end
6875

6976
# Problematic on Windows.
70-
def x_test_io_close_blocking_fiber
77+
def test_io_close_blocking_fiber
7178
with_socket_pair do |i, o|
7279
error = nil
7380

0 commit comments

Comments
 (0)