mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
build: properly wait for external browser tunnels to terminate
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.
This commit is contained in:
committed by
Jeremy Elbourn
parent
10cd71a0ed
commit
21594d33e8
@@ -68,3 +68,7 @@ browserstack-tunnel/BrowserStackLocal -k ${BROWSER_STACK_ACCESS_KEY} ${ARGS} 2>&
|
||||
|
||||
# Wait for the tunnel to be ready and create the readyfile with the Browserstack PID
|
||||
create_ready_file ${!} &
|
||||
|
||||
# Wait for all sub processes to finish. This ensures that no zombie
|
||||
# processes are left over.
|
||||
wait
|
||||
|
||||
@@ -19,10 +19,5 @@ tunnelProcessId=$(cat ${tunnelReadyFile})
|
||||
# we cannot use killall because CircleCI base container images don't have it installed.
|
||||
kill ${tunnelProcessId}
|
||||
|
||||
while (ps -p ${tunnelProcessId} &> /dev/null); do
|
||||
printf "."
|
||||
sleep .5
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "Browserstack tunnel has been shut down"
|
||||
echo "Browserstack tunnel interrupt signal has been sent."
|
||||
|
||||
Reference in New Issue
Block a user