@@ -838,16 +838,12 @@ spec:
838838 - serviceName: httpbin-service-e2e-test
839839 servicePort: 80
840840 weight: 10
841- - serviceName: %s
842- servicePort: 9180
841+ - serviceName: nginx
842+ servicePort: 80
843843 weight: 0
844844`
845845 By ("apply ApisixRoute with zero-weight backend" )
846846 applier .MustApplyAPIv2 (types.NamespacedName {Namespace : s .Namespace (), Name : "default" }, new (apiv2.ApisixRoute ), apisixRouteSpec )
847- verifyRequest := func () int {
848- return s .NewAPISIXClient ().GET ("/get" ).WithHost ("httpbin.org" ).Expect ().Raw ().StatusCode
849- }
850-
851847 By ("wait for route to be ready" )
852848 s .RequestAssert (& scaffold.RequestAssert {
853849 Method : "GET" ,
@@ -858,8 +854,10 @@ spec:
858854 })
859855 By ("send requests to verify zero-weight behavior" )
860856 for range 30 {
861- code := verifyRequest ()
862- Expect (code ).Should (Equal (200 ))
857+ resp := s .NewAPISIXClient ().GET ("/get" ).WithHost ("httpbin.org" ).Expect ()
858+ body := resp .Body ().Raw ()
859+ // should not hit nginx
860+ Expect (body ).ShouldNot (ContainSubstring ("Hello" ))
863861 }
864862 })
865863 It ("valid backend is set even if other backend is invalid" , func () {
@@ -1181,6 +1179,7 @@ kind: ApisixUpstream
11811179metadata:
11821180 name: %s
11831181spec:
1182+ ingressClassName: apisix
11841183 externalNodes:
11851184 - type: %s
11861185 name: %s
@@ -1304,6 +1303,7 @@ kind: ApisixUpstream
13041303metadata:
13051304 name: httpbin-upstream
13061305spec:
1306+ ingressClassName: apisix
13071307 externalNodes:
13081308 - type: Domain
13091309 name: httpbin.org
@@ -1348,6 +1348,7 @@ kind: ApisixUpstream
13481348metadata:
13491349 name: httpbin-upstream
13501350spec:
1351+ ingressClassName: apisix
13511352 externalNodes:
13521353 - type: Domain
13531354 name: postman-echo.com
0 commit comments