Skip to content

Commit bb03b73

Browse files
ci: wait for job-service to be ready before e2e tests
The job-service retries postgres connection on startup. Add a wait step to ensure it's processing jobs before running tests. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 1b9cdd7 commit bb03b73

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)