Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Commit

Permalink
reduce flakiness by putting update in eventually
Browse files Browse the repository at this point in the history
  • Loading branch information
maleck13 committed Nov 13, 2023
1 parent 2871328 commit e2fd5ef
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test/e2e/gateway_single_spoke_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,13 +409,18 @@ var _ = Describe("Gateway single target cluster", func() {
}
otherHostname = gatewayapi.Hostname(strings.Join([]string{"other", tconfig.ManagedZone()}, "."))
AddListener("other", otherHostname, gatewayapi.ObjectName(otherHostname), gw)
err = tconfig.HubClient().Update(ctx, gw)
Expect(err).ToNot(HaveOccurred())

expectedLiseners := 3
Eventually(func(ctx SpecContext) error {
err = tconfig.HubClient().Update(ctx, gw)
if err != nil {
return fmt.Errorf("failed to update gateway and add new listeners: %w", err)
}
checkGateway := &gatewayapi.Gateway{}
err = tconfig.HubClient().Get(ctx, client.ObjectKey{Name: testID, Namespace: tconfig.HubNamespace()}, checkGateway)
Expect(err).ToNot(HaveOccurred())
if err != nil {
return fmt.Errorf("failed to get updated gateway after adding listeners: %w", err)
}
if len(checkGateway.Spec.Listeners) == expectedLiseners {
return nil
}
Expand Down

0 comments on commit e2fd5ef

Please sign in to comment.