diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-10-17 22:34:23 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-10-17 22:40:31 +0900 |
commit | c7eac1be518912bde3e2f22623b1398eb1b950f2 (patch) | |
tree | 1bd6c69fa6cec70785d0689df0a6cd60c8d2d12f /tool | |
parent | 13716898df666210b9067c8a3d05a162c2a6ed66 (diff) | |
download | ruby-c7eac1be518912bde3e2f22623b1398eb1b950f2.tar.gz |
Retry hung up tests verbosely
Diffstat (limited to 'tool')
-rw-r--r-- | tool/lib/test/unit.rb | 15 | ||||
-rw-r--r-- | tool/test/testunit/test_parallel.rb | 2 |
2 files changed, 13 insertions, 4 deletions
diff --git a/tool/lib/test/unit.rb b/tool/lib/test/unit.rb index 6b9bebce62..c58a609bfa 100644 --- a/tool/lib/test/unit.rb +++ b/tool/lib/test/unit.rb @@ -730,14 +730,23 @@ module Test } suites.map {|r| File.realpath(r[:file])}.uniq.each {|file| require file} del_status_line or puts + error, suites = suites.partition {|r| r[:error]} unless suites.empty? puts "\n""Retrying..." @verbose = options[:verbose] - error, suites = suites.partition {|r| r[:error]} suites.map! {|r| ::Object.const_get(r[:testcase])} - error.map! {|r| ::Object.const_get(r[:testcase])} _run_suites(suites, type) + end + unless error.empty? + puts "\n""Retrying hung up testcases..." + error.map! {|r| ::Object.const_get(r[:testcase])} + verbose = @verbose + job_status = options[:job_status] + options[:verbose] = @verbose = true + options[:job_status] = :normal result.concat _run_suites(error, type) + options[:verbose] = @verbose = verbose + options[:job_status] = job_status end @options[:parallel] = parallel end @@ -915,7 +924,7 @@ module Test end def jobs_status(worker) - return if !@options[:job_status] or @options[:verbose] + return if !@options[:job_status] or @verbose if @options[:job_status] == :replace status_line = @workers.map(&:to_s).join(" ") else diff --git a/tool/test/testunit/test_parallel.rb b/tool/test/testunit/test_parallel.rb index c1caa3c691..56ebb7df90 100644 --- a/tool/test/testunit/test_parallel.rb +++ b/tool/test/testunit/test_parallel.rb @@ -212,7 +212,7 @@ module TestParallel def test_hungup spawn_runner "--worker-timeout=1", "test4test_hungup.rb" buf = Timeout.timeout(TIMEOUT) {@test_out.read} - assert_match(/^Retrying\.+$/, buf) + assert_match(/^Retrying hung up testcases\.+$/, buf) assert_match(/^2 tests,.* 0 failures,/, buf) end end |