Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ env:
- BROWSER_STACK_ACCESS_KEY=BWCd4SynLzdDcv8xtzsB
- ARCH=linux-x64
- BROWSER_PROVIDER_READY_FILE=/tmp/angular-material2-build/readyfile
- BROWSER_PROVIDER_ERROR_FILE=/tmp/angular-material2-build/errorfile
# GITHUB_TOKEN_ANGULAR
- secure: "fq/U7VDMWO8O8SnAQkdbkoSe2X92PVqg4d044HmRYVmcf6YbO48+xeGJ8yOk0pCBwl3ISO4Q2ot0x546kxfiYBuHkZetlngZxZCtQiFT9kyId8ZKcYdXaIW9OVdw3Gh3tQyUwDucfkVhqcs52D6NZjyE2aWZ4/d1V4kWRO/LMgo="
matrix:
Expand Down
2 changes: 1 addition & 1 deletion scripts/browserstack/start_tunnel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function create_ready_file {

# To be able to exit the tail properly we need to have a sub shell spawned, which is
# used to track the state of tail.
sleep 120 &
{ sleep 120; touch $BROWSER_PROVIDER_ERROR_FILE; } &

TIMER_PID=$!

Expand Down
6 changes: 6 additions & 0 deletions scripts/browserstack/waitfor_tunnel.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

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

# Wait for Connect to be ready before exiting
# Time out if we wait for more than 2 minutes, so the process won't run forever.
Expand All @@ -12,6 +13,11 @@ while [ ! -f $BROWSER_PROVIDER_READY_FILE ]; do
echo
echo "Timed out after 2 minutes waiting for tunnel ready file"
exit 5
elif [ -f $BROWSER_PROVIDER_ERROR_FILE ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a race condition here, since READY_FILE will still be created when ERROR_FILE exists. Moving this IF outside the while will ensure we always take care of this case.

echo
echo "An error occurred while starting the tunnel. See error:"
cat $TUNNEL_LOG
exit 5
fi

printf "."
Expand Down