mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Cleanup timeouts for networking tests
This commit is contained in:
parent
f6c7d70092
commit
4c5a963463
@ -68,16 +68,6 @@ const (
|
|||||||
defaultServeHostnameServicePort = 80
|
defaultServeHostnameServicePort = 80
|
||||||
defaultServeHostnameServiceName = "svc-hostname"
|
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
|
// AffinityTimeout is the maximum time that CheckAffinity is allowed to take; this
|
||||||
// needs to be more than long enough for AffinityConfirmCount HTTP requests to
|
// 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
|
// complete in a busy CI cluster, but shouldn't be too long since we will end 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)
|
cmd := fmt.Sprintf("for i in $(seq 0 %d); do echo; %s ; done", AffinityConfirmCount, curl)
|
||||||
timeout := AffinityTimeout
|
timeout := AffinityTimeout
|
||||||
if execPod == nil {
|
if execPod == nil {
|
||||||
timeout = LoadBalancerPollTimeout
|
timeout = e2eservice.LoadBalancerPollTimeout
|
||||||
}
|
}
|
||||||
var tracker affinityTracker
|
var tracker affinityTracker
|
||||||
// interval considering a maximum of 2 seconds per connection
|
// interval considering a maximum of 2 seconds per connection
|
||||||
@ -316,7 +306,7 @@ func verifyServeHostnameServiceUp(c clientset.Interface, ns, host string, expect
|
|||||||
gotEndpoints := sets.NewString()
|
gotEndpoints := sets.NewString()
|
||||||
|
|
||||||
// Retry cmdFunc for a while
|
// 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") {
|
for _, endpoint := range strings.Split(cmdFunc(), "\n") {
|
||||||
trimmedEp := strings.TrimSpace(endpoint)
|
trimmedEp := strings.TrimSpace(endpoint)
|
||||||
if trimmedEp != "" {
|
if trimmedEp != "" {
|
||||||
|
Loading…
Reference in New Issue
Block a user