From df79cb097b1c5a0186d4158091becc9c60f368fb Mon Sep 17 00:00:00 2001 From: E M <5089238+emizzle@users.noreply.github.com> Date: Fri, 24 Apr 2026 15:01:45 +1000 Subject: [PATCH] refactor polling loop --- .github/workflows/release.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2dfb084d..1c3b125d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -317,9 +317,13 @@ jobs: - name: Wait for test pod to start run: | - echo "Waiting for pod to be created..." - timeout 120 bash -c \ - 'until kubectl get pod -l job-name=$NAMEPREFIX -n default --no-headers 2>/dev/null | grep -q .; do sleep 5; done' + echo "Waiting for job to have an active pod..." + deadline=$((SECONDS + 120)) + while [[ $SECONDS -lt $deadline ]]; do + active=$(kubectl get job $NAMEPREFIX -n default -o jsonpath='{.status.active}' 2>/dev/null) + [[ "$active" == "1" ]] && break + sleep 5 + done kubectl wait \ --for=condition=Ready \ pod \