mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 16:29:21 +00:00
Make e2eservice.CheckAffinity wait longer, to avoid flakes
This commit is contained in:
parent
41a4133318
commit
cc8d3335b7
@ -34,7 +34,7 @@ import (
|
|||||||
func CheckAffinity(execPod *v1.Pod, serviceIP string, servicePort int, shouldHold bool) bool {
|
func CheckAffinity(execPod *v1.Pod, serviceIP string, servicePort int, shouldHold bool) bool {
|
||||||
serviceIPPort := net.JoinHostPort(serviceIP, strconv.Itoa(servicePort))
|
serviceIPPort := net.JoinHostPort(serviceIP, strconv.Itoa(servicePort))
|
||||||
cmd := fmt.Sprintf(`curl -q -s --connect-timeout 2 http://%s/`, serviceIPPort)
|
cmd := fmt.Sprintf(`curl -q -s --connect-timeout 2 http://%s/`, serviceIPPort)
|
||||||
timeout := TestTimeout
|
timeout := AffinityTimeout
|
||||||
if execPod == nil {
|
if execPod == nil {
|
||||||
timeout = LoadBalancerPollTimeout
|
timeout = LoadBalancerPollTimeout
|
||||||
}
|
}
|
||||||
|
@ -72,6 +72,12 @@ const (
|
|||||||
// TestTimeout is used for most polling/waiting activities
|
// TestTimeout is used for most polling/waiting activities
|
||||||
TestTimeout = 60 * time.Second
|
TestTimeout = 60 * time.Second
|
||||||
|
|
||||||
|
// 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
|
||||||
|
// waiting the entire time in the tests where affinity is not expected.
|
||||||
|
AffinityTimeout = 2 * time.Minute
|
||||||
|
|
||||||
// AffinityConfirmCount is the number of needed continuous requests to confirm that
|
// AffinityConfirmCount is the number of needed continuous requests to confirm that
|
||||||
// affinity is enabled.
|
// affinity is enabled.
|
||||||
AffinityConfirmCount = 15
|
AffinityConfirmCount = 15
|
||||||
|
Loading…
Reference in New Issue
Block a user