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
This commit is contained in:
normal 2018-04-21 23:32:18 +00:00
Родитель c83decf69a
Коммит fed7f81b37
1 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -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