diff --git a/Library/Homebrew/test.rb b/Library/Homebrew/test.rb index 11ed7f37b3..838556e17f 100644 --- a/Library/Homebrew/test.rb +++ b/Library/Homebrew/test.rb @@ -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