mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
PokeHTTP default timeout to avoid hanging connections
This commit is contained in:
parent
21073e3b34
commit
8e2eeffa79
@ -900,8 +900,8 @@ func (config *NetworkingTestConfig) getServiceClient() coreclientset.ServiceInte
|
|||||||
|
|
||||||
// HTTPPokeParams is a struct for HTTP poke parameters.
|
// HTTPPokeParams is a struct for HTTP poke parameters.
|
||||||
type HTTPPokeParams struct {
|
type HTTPPokeParams struct {
|
||||||
Timeout time.Duration
|
Timeout time.Duration // default = 10 secs
|
||||||
ExpectCode int // default = 200
|
ExpectCode int // default = 200
|
||||||
BodyContains string
|
BodyContains string
|
||||||
RetriableCodes []int
|
RetriableCodes []int
|
||||||
EnableHTTPS bool
|
EnableHTTPS bool
|
||||||
@ -981,6 +981,10 @@ func PokeHTTP(host string, port int, path string, params *HTTPPokeParams) HTTPPo
|
|||||||
params.ExpectCode = http.StatusOK
|
params.ExpectCode = http.StatusOK
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if params.Timeout == 0 {
|
||||||
|
params.Timeout = 10 * time.Second
|
||||||
|
}
|
||||||
|
|
||||||
framework.Logf("Poking %q", url)
|
framework.Logf("Poking %q", url)
|
||||||
|
|
||||||
resp, err := httpGetNoConnectionPoolTimeout(url, params.Timeout)
|
resp, err := httpGetNoConnectionPoolTimeout(url, params.Timeout)
|
||||||
|
Loading…
Reference in New Issue
Block a user