From fed7f81b3761fbb5247ad3fd90fa8cb431b02627 Mon Sep 17 00:00:00 2001 From: normal Date: Sat, 21 Apr 2018 23:32:18 +0000 Subject: test/ruby/test_io.rb: try to diagnose stuck test_recycled_fd_close I can't reproduce the problem myself, but gets loop seems ought to give more useful information for tracking down where we're stuck, at least. Followup-to: r63217 cf. http://ci.rvm.jp/results/trunk-test@frontier/804284 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_io.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index ad775dffa8..fb350b971b 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -3767,28 +3767,32 @@ __END__ noex = Thread.new do # everything right and never see exceptions :) until sig_rd.wait_readable(0) IO.pipe do |r, w| - th = Thread.new { r.read(1) } + th = Thread.new { r.sysread(1) } w.write(dot) + assert_same th, th.join(30), '"good" reader timeout' assert_equal(dot, th.value) end end sig_rd.read(4) end - 1000.times do # stupid things and make exceptions: + 1000.times do |i| # stupid things and make exceptions: IO.pipe do |r,w| th = Thread.new do begin - r.read(1) + while r.gets + end rescue IOError => e e end end Thread.pass until th.stop? r.close + assert_same th, th.join(30), '"bad" reader timeout' assert_match(/stream closed/, th.value.message) end end sig_wr.write 'done' + assert_same noex, noex.join(30), '"good" writer timeout' assert_equal 'done', noex.value ,'r63216' end end -- cgit v1.2.3