Skip to content

Commit 2c30257

Browse files
ci: wait for job-service to be ready before running e2e tests
The job-service has its own retry loop to connect to postgres and may not be ready immediately after the DB setup job completes. This caused race conditions where tests would timeout waiting for jobs that the job-service hadn't started processing yet. Add a step to wait for the "starting jobs service" log message before running e2e tests. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent c868520 commit 2c30257

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

.github/workflows/test-k8s-deployment.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,19 @@ jobs:
139139
kubectl wait --for=condition=complete job/constructive-db \
140140
-n constructive-functions --timeout=180s
141141
142+
- name: Wait for job-service to be ready
143+
run: |
144+
echo "Waiting for job-service to start processing jobs..."
145+
for i in {1..30}; do
146+
if kubectl logs -n constructive-functions -l app=knative-job-service --tail=50 2>/dev/null | grep -q "starting jobs service"; then
147+
echo "Job-service is ready!"
148+
break
149+
fi
150+
echo " Attempt $i/30: job-service not ready yet..."
151+
sleep 2
152+
done
153+
kubectl logs -n constructive-functions -l app=knative-job-service --tail=20
154+
142155
- name: Port-forward postgres and run e2e tests
143156
env:
144157
PGHOST: localhost

0 commit comments

Comments
 (0)