File tree Expand file tree Collapse file tree 6 files changed +19
-16
lines changed Expand file tree Collapse file tree 6 files changed +19
-16
lines changed Original file line number Diff line number Diff line change @@ -68,3 +68,7 @@ browserstack-tunnel/BrowserStackLocal -k ${BROWSER_STACK_ACCESS_KEY} ${ARGS} 2>&
6868
6969# Wait for the tunnel to be ready and create the readyfile with the Browserstack PID
7070create_ready_file ${! } &
71+
72+ # Wait for all sub processes to finish. This ensures that no zombie
73+ # processes are left over.
74+ wait
Original file line number Diff line number Diff line change @@ -19,10 +19,5 @@ tunnelProcessId=$(cat ${tunnelReadyFile})
1919# we cannot use killall because CircleCI base container images don't have it installed.
2020kill ${tunnelProcessId}
2121
22- while (ps -p ${tunnelProcessId} & > /dev/null); do
23- printf " ."
24- sleep .5
25- done
26-
2722echo " "
28- echo " Browserstack tunnel has been shut down "
23+ echo " Browserstack tunnel interrupt signal has been sent. "
Original file line number Diff line number Diff line change 44# proper exit code.
55set -e
66
7+ # Path to the project directory.
8+ projectDir=" $( dirname ${0} ) /../.."
9+
710# Go to project directory.
8- cd $( dirname ${0} ) /../..
11+ cd ${projectDir}
912
1013# Decode access token and make it accessible for child processes.
1114export BROWSER_STACK_ACCESS_KEY=` echo ${BROWSER_STACK_ACCESS_KEY} | rev`
1215
1316# Start tunnel and wait for it being ready.
14- ./scripts/browserstack/start-tunnel.sh
17+ ./scripts/browserstack/start-tunnel.sh &
1518./scripts/browserstack/wait-tunnel.sh
1619
1720# Setup the test platform environment variable that will be read
@@ -24,3 +27,6 @@ yarn gulp ci:test
2427# Kill the Browserstack tunnel. This is necessary in order to avoid rate-limit
2528# errors that cause the unit tests to be flaky.
2629./scripts/browserstack/stop-tunnel.sh
30+
31+ # Wait for all sub processes to terminate properly.
32+ wait
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ cd $(dirname ${0})/../..
1111export SAUCE_ACCESS_KEY=` echo ${SAUCE_ACCESS_KEY} | rev`
1212
1313# Start tunnel and wait for it being ready.
14- ./scripts/saucelabs/start-tunnel.sh
14+ ./scripts/saucelabs/start-tunnel.sh &
1515./scripts/saucelabs/wait-tunnel.sh
1616
1717# Setup the test platform environment variable that will be read
@@ -24,3 +24,6 @@ yarn gulp ci:test
2424# Kill the Saucelabs tunnel. This is necessary in order to avoid rate-limit
2525# errors that cause the unit tests to be flaky.
2626./scripts/saucelabs/stop-tunnel.sh
27+
28+ # Wait for all sub processes to terminate properly.
29+ wait
Original file line number Diff line number Diff line change 3535
3636echo " Starting Sauce Connect in the background. Passed arguments: ${sauceArgs} "
3737
38- sauce-connect/bin/sc -u ${SAUCE_USERNAME} -k ${SAUCE_ACCESS_KEY} ${sauceArgs} &
38+ sauce-connect/bin/sc -u ${SAUCE_USERNAME} -k ${SAUCE_ACCESS_KEY} ${sauceArgs}
Original file line number Diff line number Diff line change @@ -19,10 +19,5 @@ tunnelProcessId=$(cat ${tunnelPidFile})
1919# we cannot use killall because CircleCI base container images don't have it installed.
2020kill ${tunnelProcessId}
2121
22- while (ps -p ${tunnelProcessId} & > /dev/null); do
23- printf " ."
24- sleep .5
25- done
26-
2722echo " "
28- echo " Sauce Connect tunnel has been shut down "
23+ echo " Sauce Connect tunnel interrupt signal has been sent. "
You can’t perform that action at this time.
0 commit comments