From cc8d3335b7cde4593201cd9eb1641958bc181001 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Wed, 23 Oct 2019 10:12:29 -0400 Subject: [PATCH] Make e2eservice.CheckAffinity wait longer, to avoid flakes --- test/e2e/framework/service/affinity_checker.go | 2 +- test/e2e/framework/service/const.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/test/e2e/framework/service/affinity_checker.go b/test/e2e/framework/service/affinity_checker.go index 5ed21ed2e4d..94e200616d5 100644 --- a/test/e2e/framework/service/affinity_checker.go +++ b/test/e2e/framework/service/affinity_checker.go @@ -34,7 +34,7 @@ import ( func CheckAffinity(execPod *v1.Pod, serviceIP string, servicePort int, shouldHold bool) bool { serviceIPPort := net.JoinHostPort(serviceIP, strconv.Itoa(servicePort)) cmd := fmt.Sprintf(`curl -q -s --connect-timeout 2 http://%s/`, serviceIPPort) - timeout := TestTimeout + timeout := AffinityTimeout if execPod == nil { timeout = LoadBalancerPollTimeout } diff --git a/test/e2e/framework/service/const.go b/test/e2e/framework/service/const.go index 64e1fc326ac..7efffdf5b49 100644 --- a/test/e2e/framework/service/const.go +++ b/test/e2e/framework/service/const.go @@ -72,6 +72,12 @@ const ( // TestTimeout is used for most polling/waiting activities 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 // affinity is enabled. AffinityConfirmCount = 15