From 67085151250dfc27b761a41713461b4873d7709c Mon Sep 17 00:00:00 2001 From: iwilltry42 Date: Tue, 6 Oct 2020 12:50:46 +0200 Subject: [PATCH] tests/e2e: add wait time between exec tries --- tests/common.sh | 3 ++- tests/test_full_lifecycle.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/common.sh b/tests/common.sh index 8bcaed0c..d60aad56 100755 --- a/tests/common.sh +++ b/tests/common.sh @@ -157,8 +157,9 @@ wait_for_pod_exec() { # $3 = max. retries (default: 10) max_retries=$([[ -n "$3" ]] && echo "$3" || echo "10") for (( i=0; i<=max_retries; i++ )); do - echo "Try #$i" + echo "Try #$i: 'kubectl exec $1 -- $2'" kubectl exec "$1" -- $2 && return 0 + sleep 1 done echo "Command '$2' in pod '$1' did NOT return successfully in $max_retries tries" return 1 diff --git a/tests/test_full_lifecycle.sh b/tests/test_full_lifecycle.sh index bb5eca1c..561b0b47 100755 --- a/tests/test_full_lifecycle.sh +++ b/tests/test_full_lifecycle.sh @@ -64,7 +64,7 @@ sleep 5 # 6. test host.k3d.internal info "Checking DNS Lookup for host.k3d.internal" -wait_for_pod_exec "testimage" "nslookup host.k3d.internal" 6 +wait_for_pod_exec "testimage" "nslookup host.k3d.internal" 10 # Cleanup