From: James Tucker Date: 2010-08-03T18:19:29+09:00 Subject: [ruby-core:31604] Re: [Backport #3646] bootstraptests/test_io.rb -- timing issue. On 2 Aug 2010, at 21:56, Christian H�ltje wrote: > Backport #3646: bootstraptests/test_io.rb -- timing issue. > http://redmine.ruby-lang.org/issues/show/3646 > > Author: Christian H�ltje > Status: Open, Priority: Normal > > What happened: > I built ruby 1.9.1-p378 on 5 boxes (linux-32, linux-65, Solaris 8 (sparc64), windows-32 and windows-64. > Windows is built with MSVC8. > Only on the windows-32 box does ruby have an error in btests-ruby, in the 3rd test in test_io.rb. > > It doesn't happen when running the test alone, but only when running all the tests prior to it. I was able to fix it by changing the test to `sleep 1` after the thread and changing assert_finish to wait for 2 seconds instead of one: > assert_finish 2, %q{ > r, w = IO.pipe > Thread.new { > w << "ab" > sleep 0.1 > w << "ab" > } > sleep 1 > r.gets("abab") > } I'm not sure what this is supposed to be testing exactly, but, it might be better as: assert_finish 2, %q{ r, w = IO.pipe Thread.new { w << 'ab' sleep 0.1 w << 'ab' }.join(1) r.gets("abab") } Unless this violates the nature of the test.