Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit f2724b2

Browse files
committed
build(travis): gracefully shut down the sauce connect tunnel after the tests are done running
This is to prevent sauce connect tunnel leaks. Closes #12921
1 parent 3850066 commit f2724b2

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ script:
6161
- ./scripts/travis/build.sh
6262

6363
after_script:
64+
- ./scripts/travis/tear_down_browser_provider.sh
6465
- ./scripts/travis/print_logs.sh
6566

6667
notifications:

lib/browserstack/teardown_tunnel.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
set -e -o pipefail
4+
5+
6+
echo "Shutting down Browserstack tunnel"
7+
echo "TODO: implement me"
8+
exit 1

lib/saucelabs/teardown_tunnel.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
set -e -o pipefail
4+
5+
6+
echo "Shutting down Sauce Connect tunnel"
7+
8+
killall sc
9+
10+
while [[ -n `ps -ef | grep "bin/sc" | grep -v "grep"` ]]; do
11+
printf "."
12+
sleep .5
13+
done
14+
15+
echo ""
16+
echo "Sauce Connect tunnel has bee shut down"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
# Has to be run from project root directory.
3+
4+
./lib/${BROWSER_PROVIDER}/teardown_tunnel.sh

0 commit comments

Comments
 (0)