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
11 changes: 10 additions & 1 deletion lib/parallel_tests/test/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,16 @@ def execute_command_and_capture_output(env, cmd, options)
capture_output(io, env, options)
end
ParallelTests.pids.delete(pid) if pid
exitstatus = $?.exitstatus

status = $?
exitstatus = if status.exitstatus
status.exitstatus
elsif status.termsig
status.termsig + 128
else
1
end

seed = output[/seed (\d+)/, 1]

output = "#{Shellwords.shelljoin(cmd)}\n#{output}" if report_process_command?(options) && options[:serialize_stdout]
Expand Down
7 changes: 7 additions & 0 deletions spec/parallel_tests/test/runner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,13 @@ def run_with_file(content)
end
end

it "returns exit status 128 + signal number when terminated by signal", unless: Gem.win_platform? do
run_with_file("Process.kill('KILL', Process.pid)") do |path|
result = call(["ruby", path], 1, 4, {})
expect(result[:exit_status]).to eq 128 + 9 # SIGKILL = 9
end
end

it "prints each stream to the correct stream" do
skip "open3"
_out, err = run_with_file("puts 123 ; $stderr.puts 345 ; exit 5") do |path|
Expand Down
Loading