Issue #4542 has been updated by Yutaka HARA.


I found a way to reproduce this every time:

 /home/yhara/temp/ruby_1_9_2_svn % svn di
 Index: test/ruby/test_io.rb
 ===================================================================
 --- test/ruby/test_io.rb        (????????? 31238)
 +++ test/ruby/test_io.rb        (?業??????)
 @@ -1665,7 +1665,7 @@
        Thread.new {sleep 1; t.kill; p 'hi!'}
        t.join
      }.gsub(/^\s+/, '')
 -    10.times.map do
 +    100.times.map do
        Thread.start do
          assert_in_out_err([], src, [%q["hi!"]])
        end

Result:

 /home/yhara/temp/ruby_1_9_2_svn % make test-all TESTS=test/ruby/test_io.rb
 ./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb  ./tool/runruby.rb --extout=.ext  -- "./test/runner.rb" test/ruby/test_io.rb
 Loaded suite ./test/runner
 Started
 ....................................................................................F........
 Finished in 9.047658 seconds.
 
   1) Failure:
 test_threaded_flush(TestIO) [/home/yhara/temp/ruby_1_9_2_svn/test/ruby/test_io.rb:1670]:
 <["\"hi!\""]> expected but was
 <[]>.
 
 93 tests, 431 assertions, 1 failures, 0 errors, 0 skips
 
 Test run options: --seed 49147
 make: *** [yes-test-all] ????? 1

----------------------------------------
Bug #4542: test_threaded_flush sometimes fails
http://redmine.ruby-lang.org/issues/4542

Author: Yutaka HARA
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 1.9.x
ruby -v: ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux]


test-all of Ruby 1.9.2 p180 sometimes shows the following error:

   2) Failure:
 test_threaded_flush(TestIO) [/var/home/yhara/ruby-1.9.2-p180/test/ruby/test_io.rb:1670]:
 <["\"hi!\""]> expected but was
 <[]>.

Unfortunately, this rarely reproduces.
* 1 of 10 tries on CentOS 5.5
* 1 on Ubuntu 10.10


-- 
http://redmine.ruby-lang.org