From d3127af9c51c341b3b3f0282ea59c179224c38e2 Mon Sep 17 00:00:00 2001 From: Dan Mihai Date: Fri, 13 Sep 2024 17:09:44 +0000 Subject: [PATCH] tests: k8s-inotify: pod termination polling Poll/wait for pod termination instead of sleeping 2 minutes. This change typically saves ~90 seconds in my test cluster. Signed-off-by: Dan Mihai --- tests/integration/kubernetes/k8s-inotify.bats | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/integration/kubernetes/k8s-inotify.bats b/tests/integration/kubernetes/k8s-inotify.bats index 193cf99dc..361fb615e 100644 --- a/tests/integration/kubernetes/k8s-inotify.bats +++ b/tests/integration/kubernetes/k8s-inotify.bats @@ -32,8 +32,10 @@ setup() { # Update configmap kubectl apply -f "${pod_config_dir}"/inotify-updated-configmap.yaml - # Ideally we'd wait for the pod to complete... - sleep 120 + # Wait for the pod to complete + command="kubectl describe pod ${pod_name} | grep \"State: \+Terminated\"" + info "Waiting ${wait_time} seconds for: ${command}" + waitForProcess "${wait_time}" "$sleep_time" "${command}" # Verify we saw the update result=$(kubectl get pod "$pod_name" --output="jsonpath={.status.containerStatuses[]}")