Fix multithread issue in the test of r35391
pipe() uses threads and its reader thread may work before the writer writes "foob". On such case, the reader will raise error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1ff181cf8c
commit
c1903a9f17
@ -1069,13 +1069,12 @@ class TestIO < Test::Unit::TestCase
|
||||
|
||||
def test_read_nonblock_with_not_empty_buffer
|
||||
skip "IO#read_nonblock is not supported on file/pipe." if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM
|
||||
pipe(proc do |w|
|
||||
with_pipe {|r, w|
|
||||
w.write "foob"
|
||||
w.close
|
||||
end, proc do |r|
|
||||
r.read_nonblock(5, s = "01234567")
|
||||
assert_equal("foob", s)
|
||||
end)
|
||||
}
|
||||
end
|
||||
|
||||
def test_read_nonblock_error
|
||||
|
Loading…
x
Reference in New Issue
Block a user