aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorEileen M. Uchitelle <eileencodes@users.noreply.github.com>2018-09-05 16:02:53 -0400
committerGitHub <noreply@github.com>2018-09-05 16:02:53 -0400
commit49c7c154ff3b418e423d16a55c8def3ac01aca6e (patch)
tree2ac7348b934bb25def36093780f8560cd75924ee /activesupport/lib
parentbd932f5d2244185527c57d81ee7b6a7762560ab5 (diff)
parent38f074f0a8ee85553d34a0a2b33ba2ece38e7bcf (diff)
downloadrails-49c7c154ff3b418e423d16a55c8def3ac01aca6e.tar.gz
rails-49c7c154ff3b418e423d16a55c8def3ac01aca6e.tar.bz2
rails-49c7c154ff3b418e423d16a55c8def3ac01aca6e.zip
Merge pull request #33604 from rails/ensure-we-always-cleanup-dbs
Ensure we always cleanup the databases
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/testing/parallelization.rb24
1 files changed, 13 insertions, 11 deletions
diff --git a/activesupport/lib/active_support/testing/parallelization.rb b/activesupport/lib/active_support/testing/parallelization.rb
index 1caac1feb3..beeb470659 100644
--- a/activesupport/lib/active_support/testing/parallelization.rb
+++ b/activesupport/lib/active_support/testing/parallelization.rb
@@ -65,22 +65,24 @@ module ActiveSupport
def start
@pool = @queue_size.times.map do |worker|
fork do
- DRb.stop_service
+ begin
+ DRb.stop_service
- after_fork(worker)
+ after_fork(worker)
- queue = DRbObject.new_with_uri(@url)
+ queue = DRbObject.new_with_uri(@url)
- while job = queue.pop
- klass = job[0]
- method = job[1]
- reporter = job[2]
- result = Minitest.run_one_method(klass, method)
+ while job = queue.pop
+ klass = job[0]
+ method = job[1]
+ reporter = job[2]
+ result = Minitest.run_one_method(klass, method)
- queue.record(reporter, result)
+ queue.record(reporter, result)
+ end
+ ensure
+ run_cleanup(worker)
end
-
- run_cleanup(worker)
end
end
end