fix(cypress): revised kill signals to processes in e2e.sh (#38692)
This commit is contained in:
@ -11,24 +11,23 @@ finally() {
|
|||||||
|
|
||||||
local exit_code="${1:-0}"
|
local exit_code="${1:-0}"
|
||||||
# This is the clean up.
|
# This is the clean up.
|
||||||
# Find any node processes running from within the client dir
|
# Find any api, client, or server node processes
|
||||||
local hanging_client_processes=$(ps aux | grep -v grep | grep client/node_modules | awk '{print $2}')
|
|
||||||
local hanging_api_processes=$(ps aux | grep -v grep | grep api-server/node_modules | awk '{print $2}')
|
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}')
|
local hanging_server_processes=$(ps aux | grep -v grep | grep 'node production-start.js' | awk '{print $2}')
|
||||||
|
|
||||||
# Send kill signal to the processes
|
# 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
|
|
||||||
|
|
||||||
kill -9 $gastby_pid $api_pid &>/dev/null
|
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
echo "Finally exiting with a status code of ${exit_code}"
|
echo "Finally exiting with a status code of ${exit_code}"
|
||||||
exit "${exit_code}"
|
exit "${exit_code}"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user