Skip to content

Commit 43ce6ec

Browse files
devversionAndrewKushnir
authored andcommitted
ci: print sauce-connect log output on timeout (angular#29084)
Currently when `sauce-connect` times out after 2min, we just print a message saying that the SauceLabs tunnel didn't establish within 2min. In order to make debugging easier, we now print the full log file output on failure. PR Close angular#29084
1 parent 842d615 commit 43ce6ec

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

.circleci/env.sh

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ else
5454
setPublicVar SAUCE_USERNAME "angular-ci";
5555
setSecretVar SAUCE_ACCESS_KEY "9b988f434ff8-fbca-8aa4-4ae3-35442987";
5656
fi
57+
setPublicVar SAUCE_LOG_FILE /tmp/angular/sauce-connect.log
5758
setPublicVar SAUCE_READY_FILE /tmp/angular/sauce-connect-ready-file.lock
5859
setPublicVar SAUCE_PID_FILE /tmp/angular/sauce-connect-pid-file.lock
5960
setPublicVar SAUCE_TUNNEL_IDENTIFIER "angular-${CIRCLE_BUILD_NUM}-${CIRCLE_NODE_INDEX}"

scripts/saucelabs/start-tunnel.sh

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ readonly currentDir=$(cd $(dirname $0); pwd)
77
# Command arguments that will be passed to sauce-connect.
88
sauceArgs=""
99

10+
if [[ ! -z "${SAUCE_LOG_FILE:-}" ]]; then
11+
mkdir -p $(dirname ${SAUCE_LOG_FILE})
12+
sauceArgs="${sauceArgs} --logfile ${SAUCE_LOG_FILE}"
13+
fi
14+
1015
if [[ ! -z "${SAUCE_READY_FILE:-}" ]]; then
1116
mkdir -p $(dirname ${SAUCE_READY_FILE})
1217
sauceArgs="${sauceArgs} --readyfile ${SAUCE_READY_FILE}"

scripts/saucelabs/wait-for-tunnel.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ while [[ ! -f ${SAUCE_READY_FILE} ]]; do
1313
# Counter needs to be multiplied by two because the while loop only sleeps a half second.
1414
# This has been made in favor of better progress logging (printing dots every half second)
1515
if [ $counter -gt $[${SAUCE_READY_FILE_TIMEOUT} * 2] ]; then
16+
echo "Timed out after ${SAUCE_READY_FILE_TIMEOUT} seconds waiting for tunnel ready file."
17+
echo "Printing logfile output:"
1618
echo ""
17-
echo "Timed out after ${SAUCE_READY_FILE_TIMEOUT} seconds waiting for tunnel ready file"
19+
cat ${SAUCE_LOG_FILE}
1820
exit 5
1921
fi
2022

0 commit comments

Comments
 (0)