Skip to content

Commit d1abfd5

Browse files
authored
test: fix unstable websocket annotation test (#2637)
1 parent 9d4accd commit d1abfd5

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

test/e2e/ingress/annotations.go

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,19 @@ spec:
266266
It("websocket", func() {
267267
Expect(s.CreateResourceFromString(fmt.Sprintf(ingressWebSocket, s.Namespace()))).ShouldNot(HaveOccurred(), "creating Ingress")
268268

269-
routes, err := s.DefaultDataplaneResource().Route().List(context.Background())
270-
Expect(err).NotTo(HaveOccurred(), "listing Route")
271-
Expect(routes).To(HaveLen(1), "checking Route length")
272-
Expect(routes[0].EnableWebsocket).To(Equal(ptr.To(true)), "checking Route EnableWebsocket")
269+
Eventually(func() bool {
270+
routes, err := s.DefaultDataplaneResource().Route().List(context.Background())
271+
if err != nil {
272+
return false
273+
}
274+
if len(routes) != 1 {
275+
return false
276+
}
277+
if routes[0].EnableWebsocket == nil || !*routes[0].EnableWebsocket {
278+
return false
279+
}
280+
return true
281+
}).WithTimeout(30 * time.Second).ProbeEvery(2 * time.Second).Should(BeTrue())
273282
})
274283
})
275284

0 commit comments

Comments
 (0)