Skip to content

Commit 9b935e3

Browse files
committed
test: adjust backoff settings
1 parent 4fb5a3b commit 9b935e3

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

tests/e2e/helper_test.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,10 @@ func (l *lbTestHelper) TearDown() {
324324
}
325325
}
326326

327-
// WaitForHTTPAvailable tries to connect to the given IP via HTTP.
328-
// It uses exponential backoff starting at 1s and capping at 30s,
329-
// waiting up to 6 minutes for a successful HTTP 200 response.
327+
// WaitForHTTPAvailable tries to connect to the given IP via HTTP or HTTPS
328+
// (controlled by useHTTPS). It uses exponential backoff starting at 1s and
329+
// capping at 30s, waiting up to 6 minutes for a successful HTTP 200 response.
330+
// Each individual request has a 5s timeout.
330331
func (l *lbTestHelper) WaitForHTTPAvailable(ingressIP string, useHTTPS bool) error {
331332
l.t.Helper()
332333

@@ -343,10 +344,14 @@ func (l *lbTestHelper) WaitForHTTPAvailable(ingressIP string, useHTTPS bool) err
343344
proto = "https"
344345
}
345346

346-
ctx, cancel := context.WithTimeout(l.t.Context(), 4*time.Minute)
347+
ctx, cancel := context.WithTimeout(l.t.Context(), 6*time.Minute)
347348
defer cancel()
348349

349-
backoffFunc := hcloud.ExponentialBackoff(2.0, time.Second)
350+
backoffFunc := hcloud.ExponentialBackoffWithOpts(hcloud.ExponentialBackoffOpts{
351+
Base: time.Second,
352+
Multiplier: 2,
353+
Cap: 30 * time.Second,
354+
})
350355
retries := 0
351356
for {
352357
resp, err := client.Get(fmt.Sprintf("%s://%s", proto, ingressIP))

0 commit comments

Comments
 (0)