Skip to content

Commit 9a7d381

Browse files
devversionjelbourn
authored andcommitted
chore(browserstack): properly teardown tunnel (#1745)
1 parent 9bb4809 commit 9a7d381

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

scripts/browserstack/start_tunnel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ tunnel.start(function(error) {
4444
});
4545

4646
if (READY_FILE) {
47-
fs.writeFile(READY_FILE, '');
47+
fs.writeFile(READY_FILE, process.pid);
4848
}
4949
}
5050
});

scripts/browserstack/teardown_tunnel.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,17 @@ set -e -o pipefail
44

55

66
echo "Shutting down Browserstack tunnel"
7-
echo "TODO: implement me"
8-
exit 1
7+
8+
PID=$(cat $BROWSER_PROVIDER_READY_FILE);
9+
10+
# Resolving the PID from the readyfile.
11+
kill $PID
12+
13+
14+
while [[ -n `ps -ef | grep $PID | grep -v "grep"` ]]; do
15+
printf "."
16+
sleep .5
17+
done
18+
19+
echo ""
20+
echo "Browserstack tunnel has been shut down"

scripts/ci/sources/tunnel.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ teardown_tunnel() {
3434
./scripts/sauce/sauce_connect_teardown.sh
3535
;;
3636
browserstack*)
37-
# ./scripts/browserstack/teardown_tunnel.sh
37+
./scripts/browserstack/teardown_tunnel.sh
3838
;;
3939
*)
4040
;;

0 commit comments

Comments
 (0)