From 6564fedbdb73786276e2b8204a03086d2560d4ad Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Sat, 23 May 2015 08:20:49 -0400 Subject: [PATCH] Set (short) timeout for http request polling --- test/e2e/service.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/e2e/service.go b/test/e2e/service.go index 3cf15f2789f..9350364eaa4 100644 --- a/test/e2e/service.go +++ b/test/e2e/service.go @@ -1091,12 +1091,14 @@ func testNotReachable(ip string, port int) { // Does an HTTP GET, but does not reuse TCP connections // This masks problems where the iptables rule has changed, but we don't see it +// This is intended for relatively quick requests (status checks), so we set a short (5 seconds) timeout func httpGetNoConnectionPool(url string) (*http.Response, error) { tr := &http.Transport{ DisableKeepAlives: true, } client := &http.Client{ Transport: tr, + Timeout: 5 * time.Second, } return client.Get(url)