Project

General

Profile

Actions

Backport #3646

closed

bootstraptests/test_io.rb -- timing issue.

Added by docwhat (Christian Höltje) over 14 years ago. Updated over 13 years ago.

Status:
Rejected
Assignee:
-
[ruby-core:31601]

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

Actions

Also available in: Atom PDF

Like0
Like0Like0