Merge pull request #6097 from sjackman/test-pgrep

test: Avoid pgrep -q, not available with GNU pgrep
This commit is contained in:
Mike McQuaid 2019-05-06 08:18:09 +01:00 committed by GitHub
commit 17d981777a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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