https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112010-08-03T18:19:45ZRuby Issue Tracking SystemBackport191 - Backport #3646: bootstraptests/test_io.rb -- timing issue.https://bugs.ruby-lang.org/issues/3646?journal_id=126692010-08-03T18:19:45Zraggi (James Tucker)jftucker@gmail.com
<ul></ul><p>=begin</p>
<p>On 2 Aug 2010, at 21:56, Christian Höltje wrote:</p>
<blockquote>
<p>Backport <a class="issue tracker-4 status-6 priority-4 priority-default closed" title="Backport: bootstraptests/test_io.rb -- timing issue. (Rejected)" href="https://bugs.ruby-lang.org/issues/3646">#3646</a>: bootstraptests/test_io.rb -- timing issue.<br>
<a href="http://redmine.ruby-lang.org/issues/show/3646" class="external">http://redmine.ruby-lang.org/issues/show/3646</a></p>
<p>Author: Christian Höltje<br>
Status: Open, Priority: Normal</p>
<p>What happened:<br>
I built ruby 1.9.1-p378 on 5 boxes (linux-32, linux-65, Solaris 8 (sparc64), windows-32 and windows-64.<br>
Windows is built with MSVC8.<br>
Only on the windows-32 box does ruby have an error in btests-ruby, in the 3rd test in test_io.rb.</p>
<p>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 <code>sleep 1</code> after the thread and changing assert_finish to wait for 2 seconds instead of one:<br>
assert_finish 2, %q{<br>
r, w = IO.pipe<br>
Thread.new {<br>
w << "ab"<br>
sleep 0.1<br>
w << "ab"<br>
}<br>
sleep 1<br>
r.gets("abab")<br>
}</p>
</blockquote>
<p>I'm not sure what this is supposed to be testing exactly, but, it might be better as:</p>
<p>assert_finish 2, %q{<br>
r, w = IO.pipe<br>
Thread.new {<br>
w << 'ab'<br>
sleep 0.1<br>
w << 'ab'<br>
}.join(1)<br>
r.gets("abab")<br>
}</p>
<p>Unless this violates the nature of the test.</p>
<p>=end</p> Backport191 - Backport #3646: bootstraptests/test_io.rb -- timing issue.https://bugs.ruby-lang.org/issues/3646?journal_id=130382010-08-27T13:43:59Zshyouhei (Shyouhei Urabe)shyouhei@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Rejected</i></li></ul><p>=begin<br>
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.<br>
=end</p>