Skip to content

Commit

Permalink
Fail when we reach the maximum number of attempts
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrf committed Apr 1, 2024
1 parent 2bf431f commit 7dde951
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/wait-for-port.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ port=$1
echo "Waiting for port ${port}"
attempts=0
max_attempts=30
while ! curl -s "http://127.0.0.1:$port" > /dev/null && [[ $attempts -lt $max_attempts ]] ; do
while ! curl -s "http://127.0.0.1:$port" > /dev/null ; do
[[ $attempts -ge $max_attempts ]] && echo "Failed!" && exit 1
attempts=$((attempts+1))
sleep 1;
echo "waiting... (${attempts}/${max_attempts})"
Expand Down

0 comments on commit 7dde951

Please sign in to comment.