You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by ro...@apache.org on 2025/10/30 07:10:05 UTC

(apisix-ingress-controller) branch master updated: test: fix unstable websocket annotation test (#2637)

This is an automated email from the ASF dual-hosted git repository.

ronething pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git


The following commit(s) were added to refs/heads/master by this push:
     new d1abfd59 test: fix unstable websocket annotation test (#2637)
d1abfd59 is described below

commit d1abfd59e51d4c442daa47b6c6a27441c5312acc
Author: Ashing Zheng <ax...@gmail.com>
AuthorDate: Thu Oct 30 15:09:59 2025 +0800

    test: fix unstable websocket annotation test (#2637)
---
 test/e2e/ingress/annotations.go | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/test/e2e/ingress/annotations.go b/test/e2e/ingress/annotations.go
index a9c86e08..30b8ee75 100644
--- a/test/e2e/ingress/annotations.go
+++ b/test/e2e/ingress/annotations.go
@@ -266,10 +266,19 @@ spec:
 		It("websocket", func() {
 			Expect(s.CreateResourceFromString(fmt.Sprintf(ingressWebSocket, s.Namespace()))).ShouldNot(HaveOccurred(), "creating Ingress")
 
-			routes, err := s.DefaultDataplaneResource().Route().List(context.Background())
-			Expect(err).NotTo(HaveOccurred(), "listing Route")
-			Expect(routes).To(HaveLen(1), "checking Route length")
-			Expect(routes[0].EnableWebsocket).To(Equal(ptr.To(true)), "checking Route EnableWebsocket")
+			Eventually(func() bool {
+				routes, err := s.DefaultDataplaneResource().Route().List(context.Background())
+				if err != nil {
+					return false
+				}
+				if len(routes) != 1 {
+					return false
+				}
+				if routes[0].EnableWebsocket == nil || !*routes[0].EnableWebsocket {
+					return false
+				}
+				return true
+			}).WithTimeout(30 * time.Second).ProbeEvery(2 * time.Second).Should(BeTrue())
 		})
 	})