test: Avoid pgrep -q, not available with GNU pgrep

This commit is contained in:
Shaun Jackman 2019-05-05 13:58:44 -07:00
parent 7c719b756f
commit 4ab7eb93d7

View File

@ -33,7 +33,7 @@ rescue Exception => e # rubocop:disable Lint/RescueException
error_pipe.puts e.to_json
error_pipe.close
pid = Process.pid.to_s
if which("pgrep") && which("pkill") && system("pgrep", "-qP", pid)
if which("pgrep") && which("pkill") && system("pgrep", "-P", pid, out: :close)
$stderr.puts "Killing child processes..."
system "pkill", "-P", pid
sleep 1