Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perform DNS check earlier in the tests #799

Merged
merged 2 commits into from
May 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions connectivity/check/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,16 @@ func (ct *ConnectivityTest) validateDeployment(ctx context.Context) error {
}
}

// Set the timeout for all DNS lookup retries
dnsCtx, cancel := context.WithTimeout(ctx, ct.params.ipCacheTimeout())
defer cancel()
for _, cp := range ct.clientPods {
err := ct.waitForDNS(dnsCtx, cp)
if err != nil {
return err
}
}

perfPods, err := ct.client.ListPods(ctx, ct.params.TestNamespace, metav1.ListOptions{LabelSelector: "kind=" + kindPerfName})
if err != nil {
return fmt.Errorf("unable to list perf pods: %w", err)
Expand Down Expand Up @@ -692,16 +702,6 @@ func (ct *ConnectivityTest) validateDeployment(ctx context.Context) error {
}
}

// Set the timeout for all DNS lookup retries
dnsCtx, cancel := context.WithTimeout(ctx, ct.params.ipCacheTimeout())
defer cancel()
for _, cp := range ct.clientPods {
err := ct.waitForDNS(dnsCtx, cp)
if err != nil {
return err
}
}

return nil
}

Expand Down Expand Up @@ -813,7 +813,7 @@ func (ct *ConnectivityTest) waitForService(ctx context.Context, service Service)
for {
select {
case <-ctx.Done():
return fmt.Errorf("timeout reached waiting for %s", service)
return fmt.Errorf("timeout reached waiting for service %s", service.Name())
default:
}

Expand Down