aboutsummaryrefslogtreecommitdiffstats
path: root/extras/hs-test/infra/utils.go
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2024-10-02 09:00:19 +0200
committerFlorin Coras <florin.coras@gmail.com>2024-10-03 19:25:21 +0000
commitfa5defdc2d7f674b2a9a68030bf2af993c42ad01 (patch)
treec94f5f4cf41afaa71f1a8944594c978c46c95e38 /extras/hs-test/infra/utils.go
parent46ab0b22bb2915c28ae30d26501ea4cfa1f9b577 (diff)
hs-test: prom consecutive connections test
Type: test Change-Id: Ide4571dd8ac9bcb64fcd5ba408b6d1f99d34185f Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'extras/hs-test/infra/utils.go')
-rw-r--r--extras/hs-test/infra/utils.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/extras/hs-test/infra/utils.go b/extras/hs-test/infra/utils.go
index ee528370280..a32acb30193 100644
--- a/extras/hs-test/infra/utils.go
+++ b/extras/hs-test/infra/utils.go
@@ -86,13 +86,13 @@ func (s *Stanza) SaveToFile(fileName string) error {
}
// NewHttpClient creates [http.Client] with disabled proxy and redirects, it also sets timeout to 30seconds.
-func NewHttpClient() *http.Client {
+func NewHttpClient(timeout time.Duration) *http.Client {
transport := http.DefaultTransport
transport.(*http.Transport).Proxy = nil
transport.(*http.Transport).DisableKeepAlives = true
client := &http.Client{
Transport: transport,
- Timeout: time.Second * 30,
+ Timeout: timeout,
CheckRedirect: func(req *http.Request, via []*http.Request) error {
return http.ErrUseLastResponse
}}