diff options
author | John Hawthorn <john@hawthorn.email> | 2019-05-31 09:05:47 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-31 09:05:47 -0700 |
commit | 06ae49d99c4bc6263a913529ca969d5505fcfdbe (patch) | |
tree | 1954202751bdbb7ba27086eac619d78009683ffb /activesupport | |
parent | 5ce1f66d7ac50492f4cd1e6bd0170b2c888ec73d (diff) | |
parent | 9fd02d181a0706cd3a98e08b2caa7c9ed3c39b50 (diff) | |
download | rails-06ae49d99c4bc6263a913529ca969d5505fcfdbe.tar.gz rails-06ae49d99c4bc6263a913529ca969d5505fcfdbe.tar.bz2 rails-06ae49d99c4bc6263a913529ca969d5505fcfdbe.zip |
Merge pull request #36369 from jhawthorn/parallel_worker_crash
Fail parallel tests if workers exit early
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/testing/parallelization.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/testing/parallelization.rb b/activesupport/lib/active_support/testing/parallelization.rb index e760bf5ce3..f50a5e0554 100644 --- a/activesupport/lib/active_support/testing/parallelization.rb +++ b/activesupport/lib/active_support/testing/parallelization.rb @@ -27,6 +27,10 @@ module ActiveSupport @queue << o end + def length + @queue.length + end + def pop; @queue.pop; end end @@ -109,6 +113,10 @@ module ActiveSupport def shutdown @queue_size.times { @queue << nil } @pool.each { |pid| Process.waitpid pid } + + if @queue.length > 0 + raise "Queue not empty, but all workers have finished. This probably means that a worker crashed and #{@queue.length} tests were missed." + end end private |