diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-28 06:05:43 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-28 06:05:43 +0000 |
commit | 15da4792dee9692f16f4fb435a7cf058da59fc69 (patch) | |
tree | de14ff7d3b15fd4dcf9e7b7dade0388825db3cd4 /test/rake/test_rake_thread_pool.rb | |
parent | ea9e8fedb3f34be88b97d634e5cf4e61bd05432e (diff) | |
download | ruby-15da4792dee9692f16f4fb435a7cf058da59fc69.tar.gz |
test/rake: avoid leaking threads
* test/rake/test_rake_multi_task.rb (teardown): clean up thread
pool to avoid leaking threads.
* test/rake/test_rake_task_with_arguments.rb (teardown): ditto.
* test/rake/test_rake_thread_pool.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rake/test_rake_thread_pool.rb')
-rw-r--r-- | test/rake/test_rake_thread_pool.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/rake/test_rake_thread_pool.rb b/test/rake/test_rake_thread_pool.rb index 93f32fb35a..421c38d90d 100644 --- a/test/rake/test_rake_thread_pool.rb +++ b/test/rake/test_rake_thread_pool.rb @@ -33,6 +33,8 @@ class TestRakeTestThreadPool < Rake::TestCase refute_equal threads[0], threads[1] refute_equal Thread.current, threads[0] refute_equal Thread.current, threads[1] + ensure + pool.join end def test_pool_creates_the_correct_number_of_threads @@ -95,6 +97,8 @@ class TestRakeTestThreadPool < Rake::TestCase assert_raises(CustomError) do pool.future(2, &deep_exception_block).value end + ensure + pool.join end def test_pool_prevents_deadlock |