Skip to content

Commit

Permalink
Cleanup timeouts for networking tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtek-t committed Apr 2, 2020
1 parent f6c7d70 commit 4c5a963
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions test/e2e/network/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,6 @@ const (
defaultServeHostnameServicePort = 80
defaultServeHostnameServiceName = "svc-hostname"

// KubeProxyLagTimeout is the maximum time a kube-proxy daemon on a node is allowed
// to not notice a Service update, such as type=NodePort.
// TODO: This timeout should be O(10s), observed values are O(1m), 5m is very
// liberal. Fix tracked in #20567.
KubeProxyLagTimeout = 5 * time.Minute

// LoadBalancerPollTimeout is the time required by the loadbalancer to poll.
// On average it takes ~6 minutes for a single backend to come online in GCE.
LoadBalancerPollTimeout = 22 * time.Minute

// AffinityTimeout is the maximum time that CheckAffinity is allowed to take; this
// needs to be more than long enough for AffinityConfirmCount HTTP requests to
// complete in a busy CI cluster, but shouldn't be too long since we will end up
Expand Down Expand Up @@ -124,7 +114,7 @@ func checkAffinity(execPod *v1.Pod, serviceIP string, servicePort int, shouldHol
cmd := fmt.Sprintf("for i in $(seq 0 %d); do echo; %s ; done", AffinityConfirmCount, curl)
timeout := AffinityTimeout
if execPod == nil {
timeout = LoadBalancerPollTimeout
timeout = e2eservice.LoadBalancerPollTimeout
}
var tracker affinityTracker
// interval considering a maximum of 2 seconds per connection
Expand Down Expand Up @@ -316,7 +306,7 @@ func verifyServeHostnameServiceUp(c clientset.Interface, ns, host string, expect
gotEndpoints := sets.NewString()

// Retry cmdFunc for a while
for start := time.Now(); time.Since(start) < KubeProxyLagTimeout; time.Sleep(5 * time.Second) {
for start := time.Now(); time.Since(start) < e2eservice.KubeProxyLagTimeout; time.Sleep(5 * time.Second) {
for _, endpoint := range strings.Split(cmdFunc(), "\n") {
trimmedEp := strings.TrimSpace(endpoint)
if trimmedEp != "" {
Expand Down

0 comments on commit 4c5a963

Please sign in to comment.