ruby-changes:53605
From: k0kubun <ko1@a...>
Date: Tue, 20 Nov 2018 11:16:35 +0900 (JST)
Subject: [ruby-changes:53605] k0kubun:r65821 (trunk): revert r65820 and retry assert_finish
k0kubun 2018-11-20 11:16:30 +0900 (Tue, 20 Nov 2018) New Revision: 65821 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65821 Log: revert r65820 and retry assert_finish From: MSP-Greg <greg.mpls@g...> https://github.com/ruby/ruby/commit/5187ea768f57315e61486122d688f1992d4cb21f Modified files: trunk/bootstraptest/pending.rb trunk/bootstraptest/runner.rb trunk/bootstraptest/test_thread.rb Index: bootstraptest/test_thread.rb =================================================================== --- bootstraptest/test_thread.rb (revision 65820) +++ bootstraptest/test_thread.rb (revision 65821) @@ -249,6 +249,12 @@ assert_equal 'ok', %{ https://github.com/ruby/ruby/blob/trunk/bootstraptest/test_thread.rb#L249 } assert_finish 3, %{ + th = Thread.new {sleep 0.2} + th.join(0.1) + th.join +} + +assert_finish 3, %{ require 'timeout' th = Thread.new {sleep 0.2} begin Index: bootstraptest/runner.rb =================================================================== --- bootstraptest/runner.rb (revision 65820) +++ bootstraptest/runner.rb (revision 65821) @@ -383,8 +383,14 @@ def assert_finish(timeout_seconds, tests https://github.com/ruby/ruby/blob/trunk/bootstraptest/runner.rb#L383 end if io.respond_to?(:read_nonblock) if IO.select([io], nil, nil, diff) + tries = 0 begin io.read_nonblock(1024) + rescue IO::WaitReadable + IO.select([io]) + tries += 1 + break if tries > 3 + retry rescue Errno::EAGAIN, EOFError break end while true Index: bootstraptest/pending.rb =================================================================== --- bootstraptest/pending.rb (revision 65820) +++ bootstraptest/pending.rb (revision 65821) @@ -37,11 +37,3 @@ assert_normal_exit %q{ https://github.com/ruby/ruby/blob/trunk/bootstraptest/pending.rb#L37 r.instance_eval { initialize r, r } r.inspect } - -# This test randomly fails on AppVeyor msys2 with: -# test_thread.rb: A non-blocking socket operation could not be completed immediately. - read would block -assert_finish 3, %{ - th = Thread.new {sleep 0.2} - th.join(0.1) - th.join -} -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/