Backport #3646
closedbootstraptests/test_io.rb -- timing issue.
Description
=begin
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 just guessing, but I think the problem is that it is doing garbage collection or something that needs to finish before the writes in the thread take hold.
=end