From 24c163e6e182d8411205b48cc2098c052455062e Mon Sep 17 00:00:00 2001 From: Wainer dos Santos Moschetta Date: Wed, 28 Feb 2024 17:04:19 -0300 Subject: [PATCH] tests/kata-deploy: fix checker for kata-deploy running Currently, the checking for kata-deploy is running assume that the daemonset scheduled at least one pod, however it might not had and the kubectl wait command fails due to "error: no matching resources found". On CI I've observed that fail intermittently. I suspect the service account kata-deploy-sa take a while to show up then no kata-deploy is scheduled in meanwhile. Changed the checker logic to use waitForProcess() to keep testing if it is already running, or hit the timeout (still 10m). Fixes #9183 Signed-off-by: Wainer dos Santos Moschetta --- tests/functional/kata-deploy/kata-deploy.bats | 4 +++- tests/integration/kubernetes/gha-run.sh | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/functional/kata-deploy/kata-deploy.bats b/tests/functional/kata-deploy/kata-deploy.bats index 6b50e87c21..79ada144c3 100644 --- a/tests/functional/kata-deploy/kata-deploy.bats +++ b/tests/functional/kata-deploy/kata-deploy.bats @@ -57,7 +57,9 @@ setup() { else kubectl apply -f "${repo_root_dir}/tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml" fi - kubectl -n kube-system wait --timeout=10m --for=condition=Ready -l name=kata-deploy pod + + local cmd="kubectl -n kube-system get -l name=kata-deploy pod 2>/dev/null | grep '\'" + waitForProcess 600 10 "$cmd" # Give some time for the pod to finish what's doing and have the # runtimeclasses properly created diff --git a/tests/integration/kubernetes/gha-run.sh b/tests/integration/kubernetes/gha-run.sh index 8d5b69fc03..ef9ac97bd0 100755 --- a/tests/integration/kubernetes/gha-run.sh +++ b/tests/integration/kubernetes/gha-run.sh @@ -20,7 +20,7 @@ kata_tarball_dir="${2:-kata-artifacts}" DOCKER_REGISTRY=${DOCKER_REGISTRY:-quay.io} DOCKER_REPO=${DOCKER_REPO:-kata-containers/kata-deploy-ci} DOCKER_TAG=${DOCKER_TAG:-kata-containers-latest} -KATA_DEPLOY_WAIT_TIMEOUT=${KATA_DEPLOY_WAIT_TIMEOUT:-10m} +KATA_DEPLOY_WAIT_TIMEOUT=${KATA_DEPLOY_WAIT_TIMEOUT:-600} SNAPSHOTTER_DEPLOY_WAIT_TIMEOUT=${SNAPSHOTTER_DEPLOY_WAIT_TIMEOUT:-8m} KATA_HYPERVISOR=${KATA_HYPERVISOR:-qemu} KBS=${KBS:-false} @@ -156,7 +156,9 @@ function deploy_kata() { else kubectl apply -f "${tools_dir}/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml" fi - kubectl -n kube-system wait --timeout="${KATA_DEPLOY_WAIT_TIMEOUT}" --for=condition=Ready -l name=kata-deploy pod + + local cmd="kubectl -n kube-system get -l name=kata-deploy pod 2>/dev/null | grep '\'" + waitForProcess "${KATA_DEPLOY_WAIT_TIMEOUT}" 10 "$cmd" # This is needed as the kata-deploy pod will be set to "Ready" when it starts running, # which may cause issues like not having the node properly labeled or the artefacts