Skip to content

Commit

Permalink
tests/e2e: add wait time between exec tries
Browse files Browse the repository at this point in the history
  • Loading branch information
iwilltry42 committed Oct 6, 2020
1 parent dc725fc commit 6708515
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tests/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_full_lifecycle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 6708515

Please sign in to comment.