diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-29 19:47:14 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-29 19:47:14 +0000 |
commit | f1119509e60e2a6026c47a1ae2667c4d8dc928c1 (patch) | |
tree | 9ab9ba417d082fbda1c2af9059346639163a8846 /test/ruby | |
parent | ac543abe91d7325ace7254f635f34e71e1faaf2e (diff) | |
download | ruby-f1119509e60e2a6026c47a1ae2667c4d8dc928c1.tar.gz |
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
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_io.rb | 12 |
1 files changed, 7 insertions, 5 deletions
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? |