diff --git a/infra/inttest/run_pipeline.sh b/infra/inttest/run_pipeline.sh index 3ce571b..336b645 100755 --- a/infra/inttest/run_pipeline.sh +++ b/infra/inttest/run_pipeline.sh @@ -285,6 +285,16 @@ envsubst < "$REPO_ROOT/infra/inttest/redis.yaml" | kubectl apply -n "$NAMESPACE" log "Applying minio manifest ..." envsubst < "$REPO_ROOT/infra/inttest/minio.yaml" | kubectl apply -n "$NAMESPACE" -f - +# Wait for pods to be created before checking readiness +log "Waiting for infra pods to be created ..." +for i in $(seq 1 30); do + POD_COUNT=$(kubectl get pods -n "$NAMESPACE" -l 'app in (postgres,redis,minio)' --no-headers 2>/dev/null | wc -l) + if [ "$POD_COUNT" -ge 3 ]; then + break + fi + sleep 2 +done + log "Waiting for postgres readiness ..." if ! kubectl wait --for=condition=ready pod -l app=postgres -n "$NAMESPACE" --timeout=120s; then log "FATAL: PostgreSQL did not become ready"