fix: replace sleep 15 with 60s retry loop in researchowl smoke test
Polls readyReplicas every 5s up to 12 attempts instead of a fixed wait. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -31,7 +31,6 @@ spec:
|
||||
args:
|
||||
- |
|
||||
set -e
|
||||
sleep 15
|
||||
TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
|
||||
CACERT=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt
|
||||
K8S_API="https://kubernetes.default.svc"
|
||||
@@ -50,14 +49,18 @@ spec:
|
||||
}
|
||||
|
||||
echo "--- [1/1] Deployment researchowl ready replicas ---"
|
||||
READY=0
|
||||
for i in $(seq 1 12); do
|
||||
DEPLOY=$(curl -sf --max-time 15 \
|
||||
--header "Authorization: Bearer $TOKEN" \
|
||||
--cacert "$CACERT" \
|
||||
"$K8S_API/apis/apps/v1/namespaces/researchowl/deployments/researchowl") \
|
||||
|| fail "k8s API unreachable"
|
||||
|
||||
"$K8S_API/apis/apps/v1/namespaces/researchowl/deployments/researchowl") || true
|
||||
READY=$(echo "$DEPLOY" | grep -o '"readyReplicas":[0-9]*' | grep -o '[0-9]*' || echo "0")
|
||||
[ "${READY:-0}" -ge 1 ] || fail "readyReplicas=${READY:-0} (expected >= 1)"
|
||||
[ "${READY:-0}" -ge 1 ] && break
|
||||
echo "Waiting... readyReplicas=${READY:-0} (attempt $i/12)"
|
||||
sleep 5
|
||||
done
|
||||
[ "${READY:-0}" -ge 1 ] || fail "readyReplicas=${READY:-0} after 60s (expected >= 1)"
|
||||
echo "readyReplicas=$READY — OK"
|
||||
|
||||
notify "[OK] researchowl PostSync passed — deployment ready"
|
||||
|
||||
Reference in New Issue
Block a user