Skip to content

Commit 7480c82

Browse files
committed
Merge pull request kubernetes#8741 from justinsb/e2e_set_http_timeout
e2e: Set (short) timeout for http request polling
2 parents a3d5367 + 6564fed commit 7480c82

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/e2e/service.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,12 +1091,14 @@ func testNotReachable(ip string, port int) {
10911091

10921092
// Does an HTTP GET, but does not reuse TCP connections
10931093
// This masks problems where the iptables rule has changed, but we don't see it
1094+
// This is intended for relatively quick requests (status checks), so we set a short (5 seconds) timeout
10941095
func httpGetNoConnectionPool(url string) (*http.Response, error) {
10951096
tr := &http.Transport{
10961097
DisableKeepAlives: true,
10971098
}
10981099
client := &http.Client{
10991100
Transport: tr,
1101+
Timeout: 5 * time.Second,
11001102
}
11011103

11021104
return client.Get(url)

0 commit comments

Comments
 (0)