Skip to content

Commit 6c5e6b3

Browse files
committed
test/test_pair: replace sleep with IO.select
The sleep was to ensure that the SSLSocket#read_nonblock will get close_notify alert. A simple IO.select will suffice.
1 parent 6652ad7 commit 6c5e6b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/test_pair.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def test_read_nonblock
218218
assert_nothing_raised("[ruby-core:20298]") { ret = s2.read_nonblock(10) }
219219
assert_equal("def\n", ret)
220220
s1.close
221-
sleep 0.1
221+
IO.select([s2])
222222
assert_raise(EOFError) { s2.read_nonblock(10) }
223223
}
224224
end
@@ -234,7 +234,7 @@ def test_read_nonblock_no_exception
234234
assert_nothing_raised("[ruby-core:20298]") { ret = s2.read_nonblock(10, exception: false) }
235235
assert_equal("def\n", ret)
236236
s1.close
237-
sleep 0.1
237+
IO.select([s2])
238238
assert_equal(nil, s2.read_nonblock(10, exception: false))
239239
}
240240
end

0 commit comments

Comments
 (0)