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 /railties | |
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 'railties')
-rw-r--r-- | railties/test/application/test_runner_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/railties/test/application/test_runner_test.rb b/railties/test/application/test_runner_test.rb index 1ab45abcd0..7fc918898b 100644 --- a/railties/test/application/test_runner_test.rb +++ b/railties/test/application/test_runner_test.rb @@ -564,6 +564,24 @@ module ApplicationTests assert_no_match "create_table(:users)", output end + def test_run_in_parallel_with_process_worker_crash + exercise_parallelization_regardless_of_machine_core_count(with: :processes) + + file_name = app_file("test/models/parallel_test.rb", <<-RUBY) + require 'test_helper' + + class ParallelTest < ActiveSupport::TestCase + def test_crash + Kernel.exit 1 + end + end + RUBY + + output = run_test_command(file_name) + + assert_match %r{Queue not empty, but all workers have finished. This probably means that a worker crashed and 1 tests were missed.}, output + end + def test_run_in_parallel_with_threads exercise_parallelization_regardless_of_machine_core_count(with: :threads) |