From 6508c3be6530fee6bb532a8ca4b9c883d54b41f8 Mon Sep 17 00:00:00 2001 From: "Randal S. Harisch" Date: Thu, 28 Sep 2023 14:52:34 -0600 Subject: [PATCH] chore: look for job to be in active state --- pipeline/notification.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pipeline/notification.yaml b/pipeline/notification.yaml index 6917869..dbb0fa2 100644 --- a/pipeline/notification.yaml +++ b/pipeline/notification.yaml @@ -337,7 +337,8 @@ spec: claimName: "pvc-conversion" EOF MYJOB=$(oc -n goghvideo-test-${RANDOMID} get jobs -l app=e2e-test -o name) - x=0; until [[ -n $(oc -n goghvideo-test-${RANDOMID} get ${MYJOB} 2>/dev/null ) || $x -eq 60 ]]; do echo "Waiting for e2e job to start" && sleep 2 && ((x++)); done + echo "Job Reference: ${MYJOB}" + x=0; until [[ -n $(oc -n goghvideo-test-${RANDOMID} get ${MYJOB} -o jsonpath="{.status.active}") -gt 0 || $x -eq 60 ]]; do echo "Waiting for e2e job to start" && sleep 2 && ((x++)); done if [[ "${x}" -eq 60 ]]; then exit 1; fi x=0; until [[ $(oc -n goghvideo-test-${RANDOMID} get ${MYJOB} -o jsonpath="{.status.succeeded}") -gt 0 || $x -eq 20 ]]; do echo "Waiting for test to complete" && sleep 15 && ((x++)); done