Skip to content

Commit c1312ee

Browse files
committed
fix(gateway_service): Add health check after deploying gateway to ensure it is ready before starting tests
1 parent 3035ec9 commit c1312ee

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

setup-test-network.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,11 @@ docker run -d --name gateway \
189189
local-gateway:latest
190190

191191
echo "Waiting for gateway to be healthy..."
192-
if docker ps | grep -q "gateway"; then
193-
echo "Gateway is running"
194-
else
195-
echo "Gateway failed to start. Check logs with: docker logs gateway"
196-
exit 1
197-
fi
192+
echo "Waiting for gateway to be available..."
193+
194+
# Ensure gateway is ready before testing
195+
# it might take a while to start(usually 5 minutes, why???)
196+
timeout 300 bash -c 'until curl -f http://localhost:7700/ > /dev/null 2>&1; do echo "Waiting for gateway service..."; sleep 5; done'
198197

199198
echo "All services are now running!"
200199
echo "You can enjoy your new local network setup for testing."

0 commit comments

Comments
 (0)