Skip to content

Commit 6db070e

Browse files
authored
Merge pull request kubernetes#87097 from oomichi/ServiceStartTimeout
Remove duplicated ServiceStartTimeout
2 parents ce6a9f9 + a19aa10 commit 6db070e

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

test/e2e/framework/endpoints/ports.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ import (
3535
"k8s.io/kubernetes/test/e2e/framework"
3636
)
3737

38-
// ServiceStartTimeout is how long to wait for a service endpoint to be resolvable.
39-
const ServiceStartTimeout = 3 * time.Minute
40-
4138
// PortsByPodName is a map that maps pod name to container ports.
4239
type PortsByPodName map[string][]int
4340

@@ -98,9 +95,9 @@ func validatePorts(ep PortsByPodUID, expectedEndpoints PortsByPodUID) error {
9895

9996
// ValidateEndpointsPorts validates that the given service exists and is served by the given expectedEndpoints.
10097
func ValidateEndpointsPorts(c clientset.Interface, namespace, serviceName string, expectedEndpoints PortsByPodName) error {
101-
ginkgo.By(fmt.Sprintf("waiting up to %v for service %s in namespace %s to expose endpoints %v", ServiceStartTimeout, serviceName, namespace, expectedEndpoints))
98+
ginkgo.By(fmt.Sprintf("waiting up to %v for service %s in namespace %s to expose endpoints %v", framework.ServiceStartTimeout, serviceName, namespace, expectedEndpoints))
10299
i := 1
103-
for start := time.Now(); time.Since(start) < ServiceStartTimeout; time.Sleep(1 * time.Second) {
100+
for start := time.Now(); time.Since(start) < framework.ServiceStartTimeout; time.Sleep(1 * time.Second) {
104101
ep, err := c.CoreV1().Endpoints(namespace).Get(serviceName, metav1.GetOptions{})
105102
if err != nil {
106103
framework.Logf("Get endpoints failed (%v elapsed, ignoring for 5s): %v", time.Since(start), err)
@@ -132,5 +129,5 @@ func ValidateEndpointsPorts(c clientset.Interface, namespace, serviceName string
132129
} else {
133130
framework.Logf("Can't list pod debug info: %v", err)
134131
}
135-
return fmt.Errorf("Timed out waiting for service %s in namespace %s to expose endpoints %v (%v elapsed)", serviceName, namespace, expectedEndpoints, ServiceStartTimeout)
132+
return fmt.Errorf("Timed out waiting for service %s in namespace %s to expose endpoints %v (%v elapsed)", serviceName, namespace, expectedEndpoints, framework.ServiceStartTimeout)
136133
}

0 commit comments

Comments
 (0)