diff --git a/test/extended/router/scoped.go b/test/extended/router/scoped.go index 3ab50fb9a61f..5331db5f063a 100644 --- a/test/extended/router/scoped.go +++ b/test/extended/router/scoped.go @@ -290,8 +290,8 @@ func expectRouteStatusCodeRepeatedExec(ns, execPodName, url, host string, status cmd := fmt.Sprintf(` set -e - STOP=$(($(date '+%%s') + %d)) - while [ $(date '+%%s') -lt $STOP ]; do + cnt=0 + while [ $cnt -lt %d ]; do rc=0 code=$( curl %s -s -m 5 -o /dev/null -w '%%{http_code}\n' --header 'Host: %s' %q ) || rc=$? if [[ "${rc:-0}" -eq 0 ]]; then @@ -302,6 +302,8 @@ func expectRouteStatusCodeRepeatedExec(ns, execPodName, url, host string, status else echo "error ${rc}" 1>&2 fi + sleep 0.5 + cnt=$((cnt+1)) done `, times, args, host, url, statusCode) output, err := e2eoutput.RunHostCmd(ns, execPodName, cmd)