Merge pull request #117913 from daman1807/fix/curl-timeout

using --max-time instead of --connect-timeout for e2e/network/service tests.
This commit is contained in:
Kubernetes Prow Robot 2023-05-10 12:09:10 -07:00 committed by GitHub
commit 4e12a5f60f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -2754,7 +2754,7 @@ var _ = common.SIGDescribe("Services", func() {
healthCheckNodePortAddr := net.JoinHostPort(nodeIPs[0], strconv.Itoa(int(svc.Spec.HealthCheckNodePort)))
// validate that the health check node port from kube-proxy returns 200 when there are ready endpoints
err = wait.PollImmediate(time.Second, time.Minute, func() (bool, error) {
cmd := fmt.Sprintf(`curl -s -o /dev/null -w "%%{http_code}" --connect-timeout 5 http://%s/healthz`, healthCheckNodePortAddr)
cmd := fmt.Sprintf(`curl -s -o /dev/null -w "%%{http_code}" --max-time 5 http://%s/healthz`, healthCheckNodePortAddr)
out, err := e2eoutput.RunHostCmd(pausePod0.Namespace, pausePod0.Name, cmd)
if err != nil {
framework.Logf("unexpected error trying to connect to nodeport %d : %v", healthCheckNodePortAddr, err)
@ -2777,7 +2777,7 @@ var _ = common.SIGDescribe("Services", func() {
// validate that the health check node port from kube-proxy returns 503 when there are no ready endpoints
err = wait.PollImmediate(time.Second, time.Minute, func() (bool, error) {
cmd := fmt.Sprintf(`curl -s -o /dev/null -w "%%{http_code}" --connect-timeout 5 http://%s/healthz`, healthCheckNodePortAddr)
cmd := fmt.Sprintf(`curl -s -o /dev/null -w "%%{http_code}" --max-time 5 http://%s/healthz`, healthCheckNodePortAddr)
out, err := e2eoutput.RunHostCmd(pausePod0.Namespace, pausePod0.Name, cmd)
if err != nil {
framework.Logf("unexpected error trying to connect to nodeport %d : %v", healthCheckNodePortAddr, err)

View File

@ -158,7 +158,7 @@ func execHostnameTest(sourcePod v1.Pod, targetAddr, targetHostname string) {
)
framework.Logf("Waiting up to %v to get response from %s", timeout, targetAddr)
cmd := fmt.Sprintf(`curl -q -s --connect-timeout 30 %s/hostname`, targetAddr)
cmd := fmt.Sprintf(`curl -q -s --max-time 30 %s/hostname`, targetAddr)
for start := time.Now(); time.Since(start) < timeout; time.Sleep(2 * time.Second) {
stdout, err = e2eoutput.RunHostCmd(sourcePod.Namespace, sourcePod.Name, cmd)
if err != nil {