From 3b609fbae99a38680e6ced8464456e6c4aeadef4 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Tue, 22 Sep 2015 20:45:30 -0700 Subject: [PATCH] build(travis): gracefully shut down the sauce connect tunnel after the tests are done running This is to prevent tunnel leaks which cause us to run out of allocated tunnels. Closes #4329 --- scripts/ci/after-script.sh | 6 +++++- scripts/sauce/sauce_connect_teardown.sh | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100755 scripts/sauce/sauce_connect_teardown.sh diff --git a/scripts/ci/after-script.sh b/scripts/ci/after-script.sh index 503cef56ef..8c444e964f 100755 --- a/scripts/ci/after-script.sh +++ b/scripts/ci/after-script.sh @@ -2,9 +2,13 @@ set -e -o pipefail echo '*******************' -echo '** AFTER_SUCCESS **' +echo '** AFTER_SCRIPT **' echo '*******************' +if [ "$MODE" = "saucelabs" ]; then + ./scripts/sauce/sauce_connect_teardown.sh +fi + echo '---------------------' echo '-- WAIT FOR OTHERS --' diff --git a/scripts/sauce/sauce_connect_teardown.sh b/scripts/sauce/sauce_connect_teardown.sh new file mode 100755 index 0000000000..cd57a233be --- /dev/null +++ b/scripts/sauce/sauce_connect_teardown.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -e -o pipefail + + +echo "Shutting down Sauce Connect tunnel" +killall sc