summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/rake/test_rake_multi_task.rb6
-rw-r--r--test/rake/test_rake_task_with_arguments.rb1
-rw-r--r--test/rake/test_rake_thread_pool.rb4
3 files changed, 11 insertions, 0 deletions
diff --git a/test/rake/test_rake_multi_task.rb b/test/rake/test_rake_multi_task.rb
index fe10caf1db..9f8fed6d50 100644
--- a/test/rake/test_rake_multi_task.rb
+++ b/test/rake/test_rake_multi_task.rb
@@ -13,6 +13,12 @@ class TestRakeMultiTask < Rake::TestCase
@mutex = Mutex.new
end
+ def teardown
+ Rake.application.thread_pool.join
+
+ super
+ end
+
def add_run(obj)
@mutex.synchronize do
@runs << obj
diff --git a/test/rake/test_rake_task_with_arguments.rb b/test/rake/test_rake_task_with_arguments.rb
index 9d56ffbe8a..8646fc041b 100644
--- a/test/rake/test_rake_task_with_arguments.rb
+++ b/test/rake/test_rake_task_with_arguments.rb
@@ -12,6 +12,7 @@ class TestRakeTaskWithArguments < Rake::TestCase
def teardown
Rake::TaskManager.record_task_metadata = false
+ Rake.application.thread_pool.join
super
end
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