Change:
Sub-issue for For AWS ELB, when an ELB is first created, is made it is very normal that it takes 2 minutes to be created, but the DNS name is reported fairly quickly.

Discussion:
return config.f.ClientSet.Core().Namespaces() } <del> func CheckReachabilityFromPod(expectToBeReachable bool, namespace, pod, target string) { </del> <ins> func CheckReachabilityFromPod(expectToBeReachable bool, timeout time.Duration, namespace, pod, target string) { </ins> cmd := fmt.Sprintf("wget -T 5 -qO- %q", target) <del> err := wait.PollImmediate(Poll, 2*time.Minute, func() (bool, error) { </del> <ins> err := wait.PollImmediate(Poll, timeout, func() (bool, error) { </ins> _, err := RunHostCmd(namespace, pod, cmd) if expectToBeReachable && err != nil { Logf("Expect target to be reachable. But got err: %v. Retry until timeout", err)

// this feature currently supported only on GCE/GKE/AWS framework.SkipUnlessProviderIs("gce", "gke", "aws") <ins> loadBalancerLagTimeout := framework.LoadBalancerLagTimeoutDefault if framework.ProviderIs("aws") { loadBalancerLagTimeout = framework.LoadBalancerLagTimeoutAWS } </ins> loadBalancerCreateTimeout := framework.LoadBalancerCreateTimeoutDefault if nodes := framework.GetReadySchedulableNodesOrDie(cs); len(nodes.Items) > framework.LargeClusterMinNodesNumber { loadBalancerCreateTimeout = framework.LoadBalancerCreateTimeoutLarge

acceptPodName := framework.CreateExecPodOrFail(cs, namespace, "execpod-accept", nil) dropPodName := framework.CreateExecPodOrFail(cs, namespace, "execpod-drop", nil) <del> accpetPod, err := cs.Core().Pods(namespace).Get(acceptPodName, metav1.GetOptions{}) </del> <ins> acceptPod, err := cs.Core().Pods(namespace).Get(acceptPodName, metav1.GetOptions{}) </ins> Expect(err).NotTo(HaveOccurred()) dropPod, err := cs.Core().Pods(namespace).Get(dropPodName, metav1.GetOptions{}) Expect(err).NotTo(HaveOccurred())

// Create loadbalancer service with source range from node[0] and podAccept svc := jig.CreateTCPServiceOrFail(namespace, func(svc *v1.Service) { svc.Spec.Type = v1.ServiceTypeLoadBalancer <del> svc.Spec.LoadBalancerSourceRanges = []string{accpetPod.Status.PodIP + "/32"} </del> <ins> svc.Spec.LoadBalancerSourceRanges = []string{acceptPod.Status.PodIP + "/32"} </ins> }) // Clean up loadbalancer service

svc = jig.WaitForLoadBalancerOrFail(namespace, serviceName, loadBalancerCreateTimeout) jig.SanityCheckService(svc, v1.ServiceTypeLoadBalancer) <ins> // timeout when we haven't just created the load balancer normalReachabilityTimeout := 2 * time.Minute </ins> By("check reachability from different sources") svcIP := framework.GetIngressPoint(&svc.Status.LoadBalancer.Ingress[0]) <del> framework.CheckReachabilityFromPod(true, namespace, acceptPodName, svcIP) framework.CheckReachabilityFromPod(false, namespace, dropPodName, svcIP) </del> <ins> // Wait longer as this is our first request after creation.  We can't check using a separate method, // because the LB should only be reachable from the "accept" pod framework.CheckReachabilityFromPod(true, loadBalancerLagTimeout, namespace, acceptPodName, svcIP) framework.CheckReachabilityFromPod(false, normalReachabilityTimeout, namespace, dropPodName, svcIP) </ins> By("Update service LoadBalancerSourceRange and check reachability") jig.UpdateServiceOrFail(svc.Namespace, svc.Name, func(svc *v1.Service) { // only allow access from dropPod svc.Spec.LoadBalancerSourceRanges = []string{dropPod.Status.PodIP + "/32"} }) <del> framework.CheckReachabilityFromPod(false, namespace, acceptPodName, svcIP) framework.CheckReachabilityFromPod(true, namespace, dropPodName, svcIP) </del> <ins> framework.CheckReachabilityFromPod(false, normalReachabilityTimeout, namespace, acceptPodName, svcIP) framework.CheckReachabilityFromPod(true, normalReachabilityTimeout, namespace, dropPodName, svcIP) </ins> By("Delete LoadBalancerSourceRange field and check reachability") jig.UpdateServiceOrFail(svc.Namespace, svc.Name, func(svc *v1.Service) { svc.Spec.LoadBalancerSourceRanges = nil }) <del> framework.CheckReachabilityFromPod(true, namespace, acceptPodName, svcIP) framework.CheckReachabilityFromPod(true, namespace, dropPodName, svcIP) </del> <ins> framework.CheckReachabilityFromPod(true, normalReachabilityTimeout, namespace, acceptPodName, svcIP) framework.CheckReachabilityFromPod(true, normalReachabilityTimeout, namespace, dropPodName, svcIP) </ins> }) })