You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix DTS emulator connectivity with proper health check loop
Replace fixed 10-second sleep with a robust health check that:
- Actively polls port 4001 using nc until the emulator is ready
- Allows up to 60 seconds for the emulator to start
- Provides better error diagnostics if startup fails
- Adds 5 extra seconds after port is open for gRPC initialization
Co-authored-by: torosent <[email protected]>
# wait for 10 seconds, so sidecar container can be fully up, this will avoid intermittent failing issues for integration tests causing by failed to connect to sidecar
87
-
- name: Wait for 10 seconds
88
-
run: sleep 10
86
+
- name: Wait for Durable Task Emulator to be ready
87
+
run: |
88
+
echo "Waiting for Durable Task Emulator to be ready on port 4001..."
89
+
max_attempts=60
90
+
attempt=0
91
+
while ! nc -z localhost 4001 2>/dev/null; do
92
+
attempt=$((attempt + 1))
93
+
if [ $attempt -ge $max_attempts ]; then
94
+
echo "ERROR: Emulator not ready after $max_attempts seconds"
95
+
echo "Docker container status:"
96
+
docker ps -a
97
+
echo "Container logs:"
98
+
docker logs durabletask-emulator 2>&1 | tail -50
99
+
exit 1
100
+
fi
101
+
echo "Attempt $attempt/$max_attempts - waiting for emulator..."
102
+
sleep 1
103
+
done
104
+
echo "Durable Task Emulator is ready on port 4001"
105
+
# Give additional time for gRPC service to fully initialize after port is open
0 commit comments