diff --git a/.github/workflows/gke.yaml b/.github/workflows/gke.yaml index 04976a1380..f51d3def50 100644 --- a/.github/workflows/gke.yaml +++ b/.github/workflows/gke.yaml @@ -106,7 +106,17 @@ jobs: - name: Wait for job run: | - kubectl -n kube-system wait job/cilium-cli --for=condition=complete --timeout=15m + # Background wait for job to complete or timeout + kubectl -n kube-system wait job/cilium-cli --for=condition=complete --timeout=15m & + complete_pid=$! + + # Background wait for job to fail + (kubectl -n kube-system wait job/cilium-cli --for=condition=failed && exit 1) & + failed_pid=$! + + # Active wait for whichever background wait ends first + wait -n $complete_pid $failed_pid + exit $? - name: Post-test information gathering if: ${{ !success() }}