From a524593d66949708d61627f421ccf5d42dc69267 Mon Sep 17 00:00:00 2001 From: "R.B. Boyer" <4903+rboyer@users.noreply.github.com> Date: Fri, 23 Apr 2021 13:23:33 -0500 Subject: [PATCH] test: switch envoy integration tests to use pkill instead of ps+grep+awk+kill (#10097) --- test/integration/connect/envoy/helpers.bash | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/test/integration/connect/envoy/helpers.bash b/test/integration/connect/envoy/helpers.bash index 8b61c3fdf7..17dede44ac 100755 --- a/test/integration/connect/envoy/helpers.bash +++ b/test/integration/connect/envoy/helpers.bash @@ -505,26 +505,11 @@ function docker_consul_exec { docker_exec envoy_consul-${DC}_1 "$@" } -function get_envoy_pid { - local BOOTSTRAP_NAME=$1 - local DC=${2:-primary} - run ps aux - [ "$status" == 0 ] - echo "$output" 1>&2 - PID="$(echo "$output" | grep "envoy -c /workdir/$DC/envoy/${BOOTSTRAP_NAME}-bootstrap.json" | awk '{print $1}')" - [ -n "$PID" ] - - echo "$PID" -} - function kill_envoy { local BOOTSTRAP_NAME=$1 local DC=${2:-primary} - PID="$(get_envoy_pid $BOOTSTRAP_NAME "$DC")" - echo "PID = $PID" - - kill -TERM $PID + pkill -TERM -f "envoy -c /workdir/$DC/envoy/${BOOTSTRAP_NAME}-bootstrap.json" } function must_match_in_statsd_logs {