Project

General

Profile

Backport #3646

bootstraptests/test_io.rb -- timing issue.

Added by docwhat (Christian Höltje) about 9 years ago. Updated over 8 years ago.

Status:
Rejected
Priority:
Normal
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

History

#1

Updated by raggi (James Tucker) about 9 years ago

=begin

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.

=end

#2

Updated by shyouhei (Shyouhei Urabe) about 9 years ago

  • Status changed from Open to Rejected

=begin
Sorry, can't reproduce this on our mswin32 environment. Can you test it in a more recent version? Please reopen this when you still have it.
=end

Also available in: Atom PDF