lib/percy/process_helpers.rb in percy-common-3.1.4 vs lib/percy/process_helpers.rb in percy-common-3.1.5
- old
+ new
@@ -15,10 +15,15 @@
return false
rescue Errno::ECHILD
# Status has already been collected, perhaps by a Process.detach thread.
return false
rescue Timeout::Error
- Process.kill('KILL', pid)
+ begin
+ Process.kill('KILL', pid)
+ rescue Errno::ESRCH
+ # If the process has already ended, suppress any additional errors
+ return false
+ end
# Collect status so it doesn't stick around as zombie process.
Process.wait(pid, Process::WNOHANG)
end
true
end