Skip to content

Commit 2924405

Browse files
committed
test: create Load Balancer timeout of eight minutes
1 parent eb837ee commit 2924405

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

tests/e2e/helper_test.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ func (l *lbTestHelper) DeployTestPod() (*corev1.Pod, error) {
228228
return nil, fmt.Errorf("could not create test pod: %w", err)
229229
}
230230

231-
err = wait.PollUntilContextTimeout(ctx, 1*time.Second, 1*time.Minute, false, func(ctx context.Context) (done bool, err error) {
231+
err = wait.PollUntilContextTimeout(ctx, 1*time.Second, 2*time.Minute, false, func(ctx context.Context) (done bool, err error) {
232232
p, err := testCluster.k8sClient.CoreV1().Pods(l.namespace).Get(ctx, podName, metav1.GetOptions{})
233233
if err != nil {
234234
return false, err
@@ -242,7 +242,7 @@ func (l *lbTestHelper) DeployTestPod() (*corev1.Pod, error) {
242242
return false, nil
243243
})
244244
if err != nil {
245-
return nil, fmt.Errorf("pod %s did not come up after 1 minute: %w", podName, err)
245+
return nil, fmt.Errorf("pod %s did not come up after 2 minutes: %w", podName, err)
246246
}
247247

248248
return pod, nil
@@ -288,7 +288,7 @@ func (l *lbTestHelper) CreateService(lbSvc *corev1.Service) (*corev1.Service, er
288288
return nil, fmt.Errorf("could not create service: %w", err)
289289
}
290290

291-
ctx, cancel := context.WithTimeout(l.t.Context(), 6*time.Minute)
291+
ctx, cancel := context.WithTimeout(l.t.Context(), 8*time.Minute)
292292
defer cancel()
293293

294294
retries := 0
@@ -323,7 +323,9 @@ func (l *lbTestHelper) TearDown() {
323323

324324
// Use context.Background() rather than t.Context(): cleanup must run to
325325
// completion even when the test has already been cancelled or failed.
326-
err := wait.PollUntilContextTimeout(context.Background(), 1*time.Second, 3*time.Minute, true, func(ctx context.Context) (bool, error) {
326+
ctx := context.Background()
327+
328+
err := wait.PollUntilContextTimeout(ctx, 1*time.Second, 3*time.Minute, true, func(ctx context.Context) (bool, error) {
327329
err := testCluster.k8sClient.CoreV1().Namespaces().Delete(ctx, l.namespace, metav1.DeleteOptions{})
328330
if err != nil && !k8serrors.IsNotFound(err) {
329331
return false, err
@@ -338,7 +340,7 @@ func (l *lbTestHelper) TearDown() {
338340

339341
// WaitForHTTPAvailable tries to connect to the given IP via HTTP or HTTPS
340342
// (controlled by useHTTPS). It uses exponential backoff starting at 1s and
341-
// capping at 30s, waiting up to 6 minutes for a successful HTTP 200 response.
343+
// capping at 30s, waiting up to 8 minutes for a successful HTTP 200 response.
342344
// Each individual request has a 5s timeout.
343345
func (l *lbTestHelper) WaitForHTTPAvailable(ingressIP string, useHTTPS bool) error {
344346
l.t.Helper()
@@ -356,7 +358,7 @@ func (l *lbTestHelper) WaitForHTTPAvailable(ingressIP string, useHTTPS bool) err
356358
proto = "https"
357359
}
358360

359-
ctx, cancel := context.WithTimeout(l.t.Context(), 6*time.Minute)
361+
ctx, cancel := context.WithTimeout(l.t.Context(), 8*time.Minute)
360362
defer cancel()
361363

362364
retries := 0
@@ -378,7 +380,7 @@ func (l *lbTestHelper) WaitForHTTPAvailable(ingressIP string, useHTTPS bool) err
378380

379381
select {
380382
case <-ctx.Done():
381-
return fmt.Errorf("timed out after 6m waiting for %s to be available", ingressIP)
383+
return fmt.Errorf("timed out after 8m waiting for %s to be available", ingressIP)
382384
case <-time.After(pollBackoff(retries)):
383385
retries++
384386
}

0 commit comments

Comments
 (0)