Skip to content

Commit 9acb152

Browse files
devversionjelbourn
authored andcommitted
build: print logs if tunnel times out (#5279)
* The logfile output should be printed if the tunnel connection can't be established. The logging is also useful to see the update message from Saucelabs for example.
1 parent 3dee9be commit 9acb152

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

scripts/browserstack/wait-tunnel.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
TUNNEL_LOG="$LOGS_DIR/browserstack-tunnel.log"
44

5+
# Method that prints the logfile output of the browserstack tunnel.
6+
printLog() {
7+
echo "Logfile output of Browserstack tunnel (${TUNNEL_LOG}):"
8+
echo ""
9+
cat ${TUNNEL_LOG}
10+
}
11+
512
# Wait for Connect to be ready before exiting
613
# Time out if we wait for more than 2 minutes, so the process won't run forever.
714
let "counter=0"
@@ -10,7 +17,7 @@ let "counter=0"
1017
if [ -f $BROWSER_PROVIDER_ERROR_FILE ]; then
1118
echo
1219
echo "An error occurred while starting the tunnel. See error:"
13-
cat $TUNNEL_LOG
20+
printLog
1421
exit 5
1522
fi
1623

@@ -20,6 +27,7 @@ while [ ! -f $BROWSER_PROVIDER_READY_FILE ]; do
2027
if [ $counter -gt 240 ]; then
2128
echo
2229
echo "Timed out after 2 minutes waiting for tunnel ready file"
30+
printLog
2331
exit 5
2432
fi
2533

scripts/saucelabs/start-tunnel.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ TUNNEL_FILE="sc-4.4.7-linux.tar.gz"
66
TUNNEL_URL="https://saucelabs.com/downloads/${TUNNEL_FILE}"
77
TUNNEL_DIR="/tmp/saucelabs-connect"
88

9-
TUNNEL_LOG="${LOGS_DIR}/sauce-connect"
9+
TUNNEL_LOG="${LOGS_DIR}/saucelabs-tunnel.log"
1010

1111
SAUCE_ACCESS_KEY=`echo ${SAUCE_ACCESS_KEY} | rev`
1212

scripts/saucelabs/wait-tunnel.sh

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

3+
TUNNEL_LOG="$LOGS_DIR/saucelabs-tunnel.log"
4+
5+
# Method that prints the logfile output of the saucelabs tunnel.
6+
printLog() {
7+
echo "Logfile output of Saucelabs tunnel (${TUNNEL_LOG}):"
8+
echo ""
9+
cat ${TUNNEL_LOG}
10+
}
11+
312
# Wait for Saucelabs Connect to be ready before exiting
413
# Time out if we wait for more than 2 minutes, so the process won't run forever.
514
let "counter=0"
@@ -10,6 +19,7 @@ while [ ! -f $BROWSER_PROVIDER_READY_FILE ]; do
1019
if [ $counter -gt 240 ]; then
1120
echo ""
1221
echo "Timed out after 2 minutes waiting for tunnel ready file"
22+
printLog
1323
exit 5
1424
fi
1525

0 commit comments

Comments
 (0)