Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/test_queue/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def summarize_internal
unassigned_suites = []
@failures = ''
@completed.each do |worker|
estatus += worker.status.exitstatus
estatus += (worker.status.exitstatus || 1)
@stats.record_suites(worker.suites)
worker.suites.each do |suite|
assignment = @assignments.delete([suite.name, suite.path])
Expand All @@ -163,13 +163,12 @@ def summarize_internal

@failures << worker.failure_output if worker.failure_output

puts " [%2d] %60s %4d suites in %.4fs (pid %d exit %d%s)" % [
puts " [%2d] %60s %4d suites in %.4fs (%s %s)" % [
worker.num,
worker.summary,
worker.suites.size,
worker.end_time - worker.start_time,
worker.pid,
worker.status.exitstatus,
worker.status.to_s,
worker.host && " on #{worker.host.split('.').first}"
]
end
Expand Down Expand Up @@ -218,6 +217,7 @@ def summarize_internal

summarize

estatus = @completed.inject(0){ |s, worker| s + (worker.status.exitstatus || 1)}
[estatus, 255].min
end

Expand Down
7 changes: 7 additions & 0 deletions test/minitest5.bats
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ assert_test_queue_force_ordering() {
assert_output_contains "MiniTestFailure#test_fail"
}

@test "recovers from child processes dying in an unorderly way" {
export KILL=1
run bundle exec minitest-queue ./test/samples/sample_minitest5.rb
assert_status 1
assert_output_contains "SIGKILL (signal 9)"
}

@test "minitest-queue fails when TEST_QUEUE_WORKERS is <= 0" {
export TEST_QUEUE_WORKERS=0
run bundle exec minitest-queue ./test/samples/sample_minitest5.rb
Expand Down
8 changes: 8 additions & 0 deletions test/samples/sample_minitest5.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ def test_fail
end
end
end

if ENV["KILL"]
class MiniTestKilledFailure < MiniTest::Test
def test_kill
Process.kill(9, $$)
end
end
end