diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-21 23:32:18 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-21 23:32:18 +0000 |
commit | fed7f81b3761fbb5247ad3fd90fa8cb431b02627 (patch) | |
tree | fc96e90e29d2a5448125e6744b7a3e53403f5455 | |
parent | c83decf69aa92d4f9a8cec85f47fbeeed7d37dd4 (diff) |
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
-rw-r--r-- | test/ruby/test_io.rb | 10 |
1 files changed, 7 insertions, 3 deletions
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 |