Skip to content

Commit 0680774

Browse files
devversionmmalerba
authored andcommitted
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.
1 parent 4851dea commit 0680774

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

scripts/browserstack/wait-tunnel.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

33
TUNNEL_LOG="$LOGS_DIR/browserstack-tunnel.log"
4+
WAIT_DELAY=60
45

56
# Method that prints the logfile output of the browserstack tunnel.
67
printLog() {
@@ -24,15 +25,17 @@ fi
2425
while [ ! -f $BROWSER_PROVIDER_READY_FILE ]; do
2526
let "counter++"
2627

27-
if [ $counter -gt 240 ]; then
28+
# Counter needs to be multiplied by two because the while loop only sleeps a half second.
29+
# This has been made in favor of better progress logging (printing dots every half second)
30+
if [ $counter -gt $[${WAIT_DELAY} * 2] ]; then
2831
echo
2932
echo "Timed out after 2 minutes waiting for tunnel ready file"
3033
printLog
3134
exit 5
3235
fi
3336

3437
printf "."
35-
sleep .5
38+
sleep 0.5
3639
done
3740

3841
echo ""

scripts/saucelabs/wait-tunnel.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

33
TUNNEL_LOG="$LOGS_DIR/saucelabs-tunnel.log"
4+
WAIT_DELAY=60
45

56
# Method that prints the logfile output of the saucelabs tunnel.
67
printLog() {
@@ -16,15 +17,17 @@ let "counter=0"
1617
while [ ! -f $BROWSER_PROVIDER_READY_FILE ]; do
1718
let "counter++"
1819

19-
if [ $counter -gt 240 ]; then
20+
# Counter needs to be multiplied by two because the while loop only sleeps a half second.
21+
# This has been made in favor of better progress logging (printing dots every half second)
22+
if [ $counter -gt $[${WAIT_DELAY} * 2] ]; then
2023
echo ""
2124
echo "Timed out after 2 minutes waiting for tunnel ready file"
2225
printLog
2326
exit 5
2427
fi
2528

2629
printf "."
27-
sleep .5
30+
sleep 0.5
2831
done
2932

3033
echo ""

0 commit comments

Comments
 (0)