Skip to content

Commit 984c679

Browse files
authored
fix: flaky HTTPRouteMixedProtocols e2e test (#9917)
fix Signed-off-by: zirain <zirain2009@gmail.com>
1 parent 90d6624 commit 984c679

2 files changed

Lines changed: 2 additions & 13 deletions

File tree

test/e2e/tests/httproute_mixed_protocols.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,8 @@ var HTTPRouteMixedProtocols = suite.ConformanceTest{
8484
},
8585
}
8686

87-
// A single matching response is enough, so the requests are not sent through
88-
// MakeRequestAndExpectEventuallyConsistentResponse: that helper asks for
89-
// TimeoutConfig.RequiredConsecutiveSuccesses (3) consecutive matches, and every
90-
// mismatch resets the count. The /mixed-protocols rule has two backendRefs, which
91-
// Envoy translates into weighted Clusters and picks between per request, so waiting
92-
// for the same backend to answer three times in a row is waiting for a coin to land
93-
// on the same side three times: it usually happens within the timeout, but not
94-
// always, which is what made this test flaky. What is asserted here is only that the
95-
// mixed HTTP and HTTPS backends are both reachable through the same rule, and one
96-
// response from each proves that.
9787
for _, res := range responses {
98-
req := http.MakeRequest(t, &res, gwAddr, "HTTP", "http")
99-
http.WaitForConsistentResponse(t, suite.RoundTripper, req, res, 1, suite.TimeoutConfig.MaxTimeToConsistency)
88+
http.MakeRequestAndExpectEventuallyConsistentResponse(t, suite.RoundTripper, suite.TimeoutConfig, gwAddr, res)
10089
}
10190
},
10291
}

test/e2e/tests/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func TimeoutConfig() config.TimeoutConfig {
8080
// The default value of RequiredConsecutiveSuccesses is 3,
8181
// which means a test needs to pass 3 times in a row to be considered successful.
8282
// This's not necessary for E2E test.
83-
timeout.RequiredConsecutiveSuccesses = 0
83+
timeout.RequiredConsecutiveSuccesses = 1
8484
return timeout
8585
}
8686

0 commit comments

Comments
 (0)