fix(cypress): revised kill signals to processes in e2e.sh (#38692)

This commit is contained in:
MarceloDamian
2020-05-08 12:34:11 -04:00
committed by GitHub
parent e616197f9a
commit 82ed7e232e

View File

@ -11,21 +11,20 @@ finally() {
local exit_code="${1:-0}"
# This is the clean up.
# Find any node processes running from within the client dir
local hanging_client_processes=$(ps aux | grep -v grep | grep client/node_modules | awk '{print $2}')
# Find any api, client, or server node processes
local hanging_api_processes=$(ps aux | grep -v grep | grep api-server/node_modules | awk '{print $2}')
local hanging_client_processes=$(ps aux | grep -v grep | grep client/node_modules | awk '{print $2}')
local hanging_server_processes=$(ps aux | grep -v grep | grep 'node production-start.js' | awk '{print $2}')
# Send kill signal to the processes
if [ ${#hanging_api_processes} -gt "0" ]; then
kill -9 $hanging_api_processes &>/dev/null
fi
if [ ${#hanging_client_processes} -gt "0" ]; then
kill -9 $hanging_client_processes &>/dev/null
fi
if [ ${#hanging_server_processes} -gt "0" ]; then
kill -9 $hanging_server_processes &>/dev/null
fi
local processes=($hanging_api_processes $hanging_client_processes $hanging_server_processes)
for pid in ${processes[@]}; do
if [ ${#pid} -gt "0" ]; then
kill -9 $pid &>/dev/null
fi
done
kill -9 $gastby_pid $api_pid &>/dev/null