Skip to content

Commit 1967dd2

Browse files
committed
gatewayapicontroller: Increase some timeouts
* test/extended/router/gatewayapicontroller.go: Increase the timeouts on some polling loops that have been observed to flake but then succeed on retry.
1 parent de162bd commit 1967dd2

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

test/extended/router/gatewayapicontroller.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,8 @@ func skipGatewayIfNonCloudPlatform(oc *exutil.CLI) {
290290

291291
func waitForIstioHealthy(oc *exutil.CLI) {
292292
resource := types.NamespacedName{Namespace: "openshift-ingress", Name: "openshift-gateway"}
293-
err := wait.PollUntilContextTimeout(context.Background(), 1*time.Second, 10*time.Minute, false, func(context context.Context) (bool, error) {
293+
timeout := 20*time.Minute
294+
err := wait.PollUntilContextTimeout(context.Background(), 10*time.Second, timeout, false, func(context context.Context) (bool, error) {
294295
istioStatus, errIstio := oc.AsAdmin().Run("get").Args("-n", resource.Namespace, "istio", resource.Name, "-o=jsonpath={.status.state}").Output()
295296
if errIstio != nil && strings.Contains(errIstio.Error(), `the server doesn't have a resource type "istio"`) {
296297
e2e.Logf("Istio CRD does not exist; retrying...")
@@ -308,11 +309,12 @@ func waitForIstioHealthy(oc *exutil.CLI) {
308309
e2e.Logf("Istio CR %q is healthy", resource.Name)
309310
return true, nil
310311
})
311-
o.Expect(err).NotTo(o.HaveOccurred(), "Istio CR %q did not reach healthy state in time", resource.Name)
312+
o.Expect(err).NotTo(o.HaveOccurred(), "Istio CR %q did not reach healthy state within %v", resource.Name, timeout)
312313
}
313314

314315
func checkGatewayClass(oc *exutil.CLI, name string) error {
315-
waitErr := wait.PollUntilContextTimeout(context.Background(), 2*time.Second, 10*time.Minute, false, func(context context.Context) (bool, error) {
316+
timeout := 20*time.Minute
317+
waitErr := wait.PollUntilContextTimeout(context.Background(), 10*time.Second, timeout, false, func(context context.Context) (bool, error) {
316318
gwc, err := oc.AdminGatewayApiClient().GatewayV1().GatewayClasses().Get(context, name, metav1.GetOptions{})
317319
if err != nil {
318320
e2e.Logf("Failed to get gatewayclass %s: %v; retrying...", name, err)
@@ -329,7 +331,7 @@ func checkGatewayClass(oc *exutil.CLI, name string) error {
329331
return false, nil
330332
})
331333

332-
o.Expect(waitErr).NotTo(o.HaveOccurred(), "Gatewayclass %s is not accepted", name)
334+
o.Expect(waitErr).NotTo(o.HaveOccurred(), "GatewayClass %q was not accepted within %v", name, timeout)
333335
return nil
334336
}
335337

@@ -362,7 +364,8 @@ func createAndCheckGateway(oc *exutil.CLI, gwname, gwclassname, domain string) (
362364

363365
func checkGatewayStatus(oc *exutil.CLI, gwname, ingressNameSpace string) (*gatewayapiv1.Gateway, error) {
364366
programmedGateway := &gatewayapiv1.Gateway{}
365-
if err := wait.PollUntilContextTimeout(context.Background(), 2*time.Second, 10*time.Minute, false, func(context context.Context) (bool, error) {
367+
timeout := 20*time.Minute
368+
if err := wait.PollUntilContextTimeout(context.Background(), 10*time.Second, timeout, false, func(context context.Context) (bool, error) {
366369
gateway, err := oc.AdminGatewayApiClient().GatewayV1().Gateways(ingressNameSpace).Get(context, gwname, metav1.GetOptions{})
367370
if err != nil {
368371
e2e.Logf("Failed to get gateway %q: %v, retrying...", gwname, err)
@@ -381,7 +384,7 @@ func checkGatewayStatus(oc *exutil.CLI, gwname, ingressNameSpace string) (*gatew
381384
e2e.Logf("Found gateway %q but the controller is still not programmed, retrying...", gwname)
382385
return false, nil
383386
}); err != nil {
384-
return nil, fmt.Errorf("timed out waiting for gateway %q to become programmed: %w", gwname, err)
387+
return nil, fmt.Errorf("timed out after %v waiting for gateway %q to become programmed: %w", timeout, gwname, err)
385388
}
386389
e2e.Logf("Gateway %q successfully programmed!", gwname)
387390
return programmedGateway, nil

0 commit comments

Comments
 (0)