From 0680774fcd4731033d716ad48be1c8d8e229b5c3 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Mon, 7 Aug 2017 19:24:09 +0200 Subject: [PATCH] ci: shorter wait timeout for saucelabs and browserstack (#6317) * Changes the wait timeout for Saucelabs and Browserstack from 2 minutes to 1 minute. This is possible now because if the timeout fails we still re-try to create a connection a second time. --- scripts/browserstack/wait-tunnel.sh | 7 +++++-- scripts/saucelabs/wait-tunnel.sh | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/browserstack/wait-tunnel.sh b/scripts/browserstack/wait-tunnel.sh index d15a104bd4b..537f4f0b5aa 100755 --- a/scripts/browserstack/wait-tunnel.sh +++ b/scripts/browserstack/wait-tunnel.sh @@ -1,6 +1,7 @@ #!/bin/bash TUNNEL_LOG="$LOGS_DIR/browserstack-tunnel.log" +WAIT_DELAY=60 # Method that prints the logfile output of the browserstack tunnel. printLog() { @@ -24,7 +25,9 @@ fi while [ ! -f $BROWSER_PROVIDER_READY_FILE ]; do let "counter++" - if [ $counter -gt 240 ]; then + # Counter needs to be multiplied by two because the while loop only sleeps a half second. + # This has been made in favor of better progress logging (printing dots every half second) + if [ $counter -gt $[${WAIT_DELAY} * 2] ]; then echo echo "Timed out after 2 minutes waiting for tunnel ready file" printLog @@ -32,7 +35,7 @@ while [ ! -f $BROWSER_PROVIDER_READY_FILE ]; do fi printf "." - sleep .5 + sleep 0.5 done echo "" diff --git a/scripts/saucelabs/wait-tunnel.sh b/scripts/saucelabs/wait-tunnel.sh index 064e8dc7502..3fd90965f08 100755 --- a/scripts/saucelabs/wait-tunnel.sh +++ b/scripts/saucelabs/wait-tunnel.sh @@ -1,6 +1,7 @@ #!/bin/bash TUNNEL_LOG="$LOGS_DIR/saucelabs-tunnel.log" +WAIT_DELAY=60 # Method that prints the logfile output of the saucelabs tunnel. printLog() { @@ -16,7 +17,9 @@ let "counter=0" while [ ! -f $BROWSER_PROVIDER_READY_FILE ]; do let "counter++" - if [ $counter -gt 240 ]; then + # Counter needs to be multiplied by two because the while loop only sleeps a half second. + # This has been made in favor of better progress logging (printing dots every half second) + if [ $counter -gt $[${WAIT_DELAY} * 2] ]; then echo "" echo "Timed out after 2 minutes waiting for tunnel ready file" printLog @@ -24,7 +27,7 @@ while [ ! -f $BROWSER_PROVIDER_READY_FILE ]; do fi printf "." - sleep .5 + sleep 0.5 done echo ""