From bf0a96a54768e5dc9328d7361253483cfdfc1ba5 Mon Sep 17 00:00:00 2001 From: Nigel Jones Date: Mon, 12 Jun 2023 17:34:52 +0100 Subject: [PATCH] #7 wait for init/config to complete & capture logs Signed-off-by: Nigel Jones --- .github/workflows/cts.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cts.yml b/.github/workflows/cts.yml index c59db2f..c4d22d7 100644 --- a/.github/workflows/cts.yml +++ b/.github/workflows/cts.yml @@ -99,7 +99,13 @@ jobs: sleep 1 done kubectl wait pods --selector=app.kubernetes.io/component=platform --for condition=Ready --timeout=5m - # We could wait for the init job to complete, but the risk is it gets purged - so for now, skip this check + - name: Wait for init/config to complete + run: | + until kubectl get pod -l app.kubernetes.io/component=init -o go-template='{{.items | len}}' | grep -qxF 1; do + echo "Waiting for pod" + sleep 1 + done + kubectl wait pods --selector=app.kubernetes.io/component=init --for condition=complete --timeout=5m - name: Wait for CTS results to be available (this takes a long time - HOURS) # This waits for the report pod to go ready - this means results are ready run: | @@ -108,7 +114,7 @@ jobs: sleep 1 done # -- note on timeouts -- - # Above we've used 25 mins. Allow 5 mins for logging retrieval, + some for attachments so allow 5:20 hours here to be safe + # Above we've used 30 mins. Allow 5 mins for logging retrieval, + some for attachments so allow 5:20 hours here to be safe # But note that kubectl exec timeouts are tricky - combo of finding running pod, connecting to pod, and running command, so are omitted below # TODO: Could be calculated based on start time of job to maximise available job run time # -- end --