tests/e2e: add wait time between exec tries

pull/368/head v3.1.0
iwilltry42 4 years ago
parent dc725fcdbc
commit 6708515125
No known key found for this signature in database
GPG Key ID: 7BA57AD1CFF16110
  1. 3
      tests/common.sh
  2. 2
      tests/test_full_lifecycle.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

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

Loading…
Cancel
Save