Skip to content

Commit

Permalink
Check services’ readiness by waiting for a 200 HTTP response instead …
Browse files Browse the repository at this point in the history
…of just checking that the TCP port is open
  • Loading branch information
julienrf committed Apr 1, 2024
1 parent fd3ba04 commit 2bf431f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion .github/wait-for-port.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ port=$1
echo "Waiting for port ${port}"
attempts=0
max_attempts=30
while ! nc -z 127.0.0.1 $port && [[ $attempts < $max_attempts ]] ; do
while ! curl -s "http://127.0.0.1:$port" > /dev/null && [[ $attempts -lt $max_attempts ]] ; do
attempts=$((attempts+1))
sleep 1;
echo "waiting... (${attempts}/${max_attempts})"
Expand Down
1 change: 0 additions & 1 deletion docker-compose-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ services:
- 7014
- 7015
- 7016
- 8881
ports:
- 5006:5006
- 8081:8081
Expand Down

0 comments on commit 2bf431f

Please sign in to comment.