mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
21594d33e8
We currently wait for browser tunnels of Saucelabs and Browserstack to terminate by repeatedly checking with `ps -p`. This is not reliable and can break if the host system is not removing forcibly killed child processes from the process table. This is valid since the tunnels are launched as child processes and we ideally wait for those to terminate using the `wait` command.
24 lines
684 B
Bash
Executable File
24 lines
684 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e -o pipefail
|
|
|
|
tunnelTmpDir="/tmp/material-browserstack"
|
|
tunnelReadyFile="${tunnelTmpDir}/readyfile"
|
|
|
|
if [[ ! -f ${tunnelReadyFile} ]]; then
|
|
echo "BrowserStack tunnel has not been started. Cannot stop tunnel.."
|
|
exit 1
|
|
fi
|
|
|
|
echo "Shutting down Browserstack tunnel.."
|
|
|
|
# The process id for the BrowserStack local instance is stored inside of the readyfile.
|
|
tunnelProcessId=$(cat ${tunnelReadyFile})
|
|
|
|
# Kill the process by using the PID that has been read from the readyfile. Note that
|
|
# we cannot use killall because CircleCI base container images don't have it installed.
|
|
kill ${tunnelProcessId}
|
|
|
|
echo ""
|
|
echo "Browserstack tunnel interrupt signal has been sent."
|