Skip to content

Commit 78814cd

Browse files
committed
fix: Add comprehensive LocalStack connectivity diagnostics to CI
- Test port 4566 connectivity with netcat before health check - Show Docker container status if connection fails - Display full health response for debugging - Show LocalStack container logs if health check fails - Helps diagnose why tests can't connect to service container
1 parent 597d828 commit 78814cd

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

.github/workflows/Release-CI.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,30 @@ jobs:
7373
- name: Step-06 Verify LocalStack is Ready
7474
run: |
7575
echo "Waiting for LocalStack to be fully ready..."
76+
echo "Testing connection to localhost:4566..."
77+
78+
# Test basic connectivity first
79+
if ! nc -zv localhost 4566 2>&1; then
80+
echo "ERROR: Cannot connect to localhost:4566"
81+
echo "Checking if LocalStack container is running..."
82+
docker ps -a
83+
exit 1
84+
fi
85+
86+
echo "Port 4566 is accessible, checking health endpoint..."
7687
max_attempts=30
7788
attempt=0
7889
while [ $attempt -lt $max_attempts ]; do
7990
if curl -f http://localhost:4566/_localstack/health 2>/dev/null; then
8091
echo "LocalStack is ready!"
92+
echo "Health endpoint response:"
8193
curl -s http://localhost:4566/_localstack/health | jq '.'
94+
95+
echo ""
96+
echo "Testing if services are available..."
97+
health_response=$(curl -s http://localhost:4566/_localstack/health)
98+
echo "Full health response: $health_response"
99+
82100
break
83101
fi
84102
attempt=$((attempt + 1))
@@ -87,8 +105,13 @@ jobs:
87105
done
88106
if [ $attempt -eq $max_attempts ]; then
89107
echo "ERROR: LocalStack did not become ready in time"
108+
echo "Checking LocalStack container logs..."
109+
docker logs $(docker ps -q --filter ancestor=localstack/localstack:latest) || echo "Could not get container logs"
90110
exit 1
91111
fi
112+
113+
echo ""
114+
echo "LocalStack is ready for tests!"
92115
93116
- name: Step-07 Restore dependencies
94117
run: dotnet restore

0 commit comments

Comments
 (0)