From f1119509e60e2a6026c47a1ae2667c4d8dc928c1 Mon Sep 17 00:00:00 2001 From: normal Date: Wed, 29 Aug 2018 19:47:14 +0000 Subject: 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 --- test/ruby/test_io.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'test/ruby') diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 7843fa0877..27077b425b 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? -- cgit v1.2.3