@@ -39,13 +39,13 @@ var EnvoyShutdownTest = suite.ConformanceTest{
3939 Description : "Deleting envoy pod should not lead to failures" ,
4040 Manifests : []string {"testdata/envoy-shutdown.yaml" },
4141 Test : func (t * testing.T , suite * suite.ConformanceTestSuite ) {
42- t .Run ("All requests must succeed" , func (t * testing.T ) {
42+ t .Run ("All requests (regular + delayed) must succeed during rollout " , func (t * testing.T ) {
4343 ns := "gateway-upgrade-infra"
4444 name := "ha-gateway"
4545 routeNN := types.NamespacedName {Name : "http-envoy-shutdown" , Namespace : ns }
4646 gwNN := types.NamespacedName {Name : name , Namespace : ns }
4747 gwAddr := kubernetes .GatewayAndRoutesMustBeAccepted (t , suite .Client , suite .TimeoutConfig , suite .ControllerName , kubernetes .NewGatewayRef (gwNN ), & gwapiv1.HTTPRoute {}, false , routeNN )
48- reqURL := url.URL {Scheme : "http" , Host : http .CalculateHost (t , gwAddr , "http" ), Path : "/envoy-shutdown" }
48+ baseURL := url.URL {Scheme : "http" , Host : http .CalculateHost (t , gwAddr , "http" ), Path : "/envoy-shutdown" }
4949 epNN := types.NamespacedName {Name : "upgrade-config" , Namespace : "envoy-gateway-system" }
5050 dp , err := getDeploymentForGateway (ns , name , suite .Client )
5151 if err != nil {
@@ -66,29 +66,39 @@ var EnvoyShutdownTest = suite.ConformanceTest{
6666 }
6767 http .MakeRequestAndExpectEventuallyConsistentResponse (t , suite .RoundTripper , suite .TimeoutConfig , gwAddr , expectedResponse )
6868
69- // can be used to abort the test after deployment restart is complete or failed
7069 aborter := periodic .NewAborter ()
71- // will contain indication on success or failure of load test
72- loadSuccess := make (chan bool )
70+ regDone := make ( chan bool )
71+ delayedDone := make (chan bool )
7372
74- t .Log ("Starting load generation" )
75- // Run load async and continue to restart deployment
76- go runLoadAndWait (t , & suite .TimeoutConfig , loadSuccess , aborter , reqURL .String ())
73+ regURL := baseURL .String ()
74+ delayedURL := func () string {
75+ u := baseURL
76+ q := u .Query ()
77+ q .Set ("delay" , "3s" )
78+ u .RawQuery = q .Encode ()
79+ return u .String ()
80+ }()
81+
82+ t .Logf ("Starting regular load to %s" , regURL )
83+ go runLoadAndWait (t , & suite .TimeoutConfig , regDone , aborter , regURL , 0 )
84+
85+ t .Logf ("Starting delayed load to %s" , delayedURL )
86+ go runLoadAndWait (t , & suite .TimeoutConfig , delayedDone , aborter , delayedURL , 10 * time .Second )
7787
7888 t .Log ("Rolling out proxy deployment" )
7989 err = restartProxyAndWaitForRollout (t , & suite .TimeoutConfig , suite .Client , epNN , dp )
8090
8191 t .Log ("Stopping load generation and collecting results" )
82- aborter .Abort (false ) // abort the load either way
92+ aborter .Abort (false )
8393
8494 if err != nil {
8595 t .Errorf ("Failed to rollout proxy deployment: %v" , err )
8696 }
87-
88- // Wait for the goroutine to finish
89- result := <- loadSuccess
90- if ! result {
91- t .Errorf ("Load test failed" )
97+ if ok := <- regDone ; ! ok {
98+ t . Errorf ( "Regular load failed during rollout" )
99+ }
100+ if ok := <- delayedDone ; ! ok {
101+ t .Errorf ("Delayed load failed during rollout " )
92102 }
93103 })
94104 },
0 commit comments