|
|
@ -390,11 +390,17 @@ func TestServerListenAndServeTLS(t *testing.T) { |
|
|
|
Transport: tr, |
|
|
|
Transport: tr, |
|
|
|
} |
|
|
|
} |
|
|
|
// Keep trying the server until it's accepting connections
|
|
|
|
// Keep trying the server until it's accepting connections
|
|
|
|
|
|
|
|
start := UTCNow() |
|
|
|
for { |
|
|
|
for { |
|
|
|
res, _ := client.Get("https://" + addr) |
|
|
|
res, _ := client.Get("https://" + addr) |
|
|
|
if res != nil && res.StatusCode == http.StatusOK { |
|
|
|
if res != nil && res.StatusCode == http.StatusOK { |
|
|
|
break |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Explicit check to terminate loop after 5 minutes
|
|
|
|
|
|
|
|
// (for investigational purpose of issue #4461)
|
|
|
|
|
|
|
|
if UTCNow().Sub(start) >= 5*time.Minute { |
|
|
|
|
|
|
|
t.Fatalf("Failed to establish connection after 5 minutes") |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Once a request succeeds, subsequent requests should
|
|
|
|
// Once a request succeeds, subsequent requests should
|
|
|
|