From 0b773c30fb5dd9822a5af21e395b1b994baca9d3 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 23 Jul 2014 10:38:41 -0700 Subject: [PATCH] specify N=0 to prevent parallel tests (just run tests on the main process) --- actionpack/test/abstract_unit.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index b07d8a7be0..987ef7de1f 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -19,6 +19,8 @@ require 'drb/unix' require 'tempfile' +PROCESS_COUNT = (ENV['N'] || 4).to_i + require 'active_support/testing/autorun' require 'abstract_controller' require 'action_controller' @@ -109,7 +111,9 @@ def before_setup module ActiveSupport class TestCase include ActionDispatch::DrawOnce - parallelize_me! if ActiveSupport::Testing::Isolation.forking_env? + if ActiveSupport::Testing::Isolation.forking_env? && PROCESS_COUNT > 0 + parallelize_me! + end end end @@ -489,7 +493,7 @@ def shutdown end end -if ActiveSupport::Testing::Isolation.forking_env? +if ActiveSupport::Testing::Isolation.forking_env? && PROCESS_COUNT > 0 # Use N processes (N defaults to 4) Minitest.parallel_executor = ForkingExecutor.new((ENV['N'] || 4).to_i) end -- GitLab