aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/testing/parallelization.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/testing/parallelization.rb')
-rw-r--r--activesupport/lib/active_support/testing/parallelization.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/testing/parallelization.rb b/activesupport/lib/active_support/testing/parallelization.rb
index 63440069b1..e760bf5ce3 100644
--- a/activesupport/lib/active_support/testing/parallelization.rb
+++ b/activesupport/lib/active_support/testing/parallelization.rb
@@ -71,7 +71,9 @@ module ActiveSupport
fork do
DRb.stop_service
- after_fork(worker)
+ begin
+ after_fork(worker)
+ rescue => setup_exception; end
queue = DRbObject.new_with_uri(@url)
@@ -79,7 +81,11 @@ module ActiveSupport
klass = job[0]
method = job[1]
reporter = job[2]
- result = Minitest.run_one_method(klass, method)
+ result = klass.with_info_handler reporter do
+ Minitest.run_one_method(klass, method)
+ end
+
+ add_setup_exception(result, setup_exception) if setup_exception
begin
queue.record(reporter, result)
@@ -104,6 +110,11 @@ module ActiveSupport
@queue_size.times { @queue << nil }
@pool.each { |pid| Process.waitpid pid }
end
+
+ private
+ def add_setup_exception(result, setup_exception)
+ result.failures.prepend Minitest::UnexpectedError.new(setup_exception)
+ end
end
end
end