tests/e2e: add wait time between exec tries

This commit is contained in:
iwilltry42 2020-10-06 12:50:46 +02:00
parent dc725fcdbc
commit 6708515125
No known key found for this signature in database
GPG Key ID: 7BA57AD1CFF16110
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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