From c1903a9f17ebda5c7c6d94e634d90e7ee0f98a72 Mon Sep 17 00:00:00 2001 From: naruse Date: Thu, 19 Apr 2012 02:49:48 +0000 Subject: 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 --- test/ruby/test_io.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index d984252cb5..ebf9b760dd 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -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 -- cgit v1.2.3