summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-29 19:47:14 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-29 19:47:14 +0000
commitf1119509e60e2a6026c47a1ae2667c4d8dc928c1 (patch)
tree9ab9ba417d082fbda1c2af9059346639163a8846
parentac543abe91d7325ace7254f635f34e71e1faaf2e (diff)
test/ruby/test_io.rb (test_select_leak): use handle_interrupt
Interrupt timing is tricky and it's possible the target thread is still stopped from the previous loop iteration. [ruby-core:88732] [Bug #15043] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/ruby/test_io.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 7843fa0..27077b4 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -3839,11 +3839,13 @@ __END__
Thread.new { IO.select(rset, wset, nil, 0) }.join
end;
th = Thread.new do
- begin
- IO.select(rset, wset)
- rescue
- retry
- end while true
+ Thread.handle_interrupt(StandardError => :on_blocking) do
+ begin
+ IO.select(rset, wset)
+ rescue
+ retry
+ end while true
+ end
end
50_000.times do
Thread.pass until th.stop?