diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-07-23 10:38:41 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-07-23 10:38:52 -0700 |
commit | 0b773c30fb5dd9822a5af21e395b1b994baca9d3 (patch) | |
tree | 8ba3a7856cf8427f734fd52b7eec23983f712322 /actionpack | |
parent | 8c48a708243236491e33290e3b5676dc27a64c05 (diff) | |
download | rails-0b773c30fb5dd9822a5af21e395b1b994baca9d3.tar.gz rails-0b773c30fb5dd9822a5af21e395b1b994baca9d3.tar.bz2 rails-0b773c30fb5dd9822a5af21e395b1b994baca9d3.zip |
specify N=0 to prevent parallel tests (just run tests on the main process)
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/test/abstract_unit.rb | 8 |
1 files 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' 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 @@ end 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 @@ class ForkingExecutor 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 |