diff options
Diffstat (limited to 'test/ruby/test_io.rb')
-rw-r--r-- | test/ruby/test_io.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index ac7570a2b3..c9b7de9181 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -3400,16 +3400,19 @@ __END__ def test_race_closed_stream bug13158 = '[ruby-core:79262] [Bug #13158]' closed = nil + q = Queue.new IO.pipe do |r, w| thread = Thread.new do begin + q << true while r.gets end ensure closed = r.closed? end end - sleep 0.01 + q.pop + sleep 0.1 # wait for blocking by r.gets r.close assert_raise_with_message(IOError, /stream closed/) do thread.join |