From 337bf75b321d4e7799470f72e331fcb676d2adea Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 2 Oct 2015 00:31:31 +0000 Subject: [PATCH] test_thread.rb: thread leak * test/ruby/test_thread.rb (test_handle_interrupt_blocking): fix thread leak. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_thread.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb index fe8e2384a0..c1606f2ff2 100644 --- a/test/ruby/test_thread.rb +++ b/test/ruby/test_thread.rb @@ -645,11 +645,9 @@ class TestThread < Test::Unit::TestCase end } } - sleep 1 - r=:ng - th.raise RuntimeError - th.join - rescue e + assert_raise(e) {sleep 1} + ensure + assert_raise(RuntimeError) {th.join(0)} end assert_equal(:ok,r) end