@@ -711,13 +711,13 @@ var _ = Describe("Zero downtime scale test", Ordered, Label("nfr", "zero-downtim
711711 }
712712
713713 var (
714- outFile * os.File
715- resultsDir string
716- ngfDeploymentName string
717- ns core.Namespace
718- metricsCh chan * metricsResults
714+ outFile * os.File
715+ resultsDir string
716+ ns core.Namespace
717+ metricsCh chan * metricsResults
719718
720- files = []string {
719+ numCoffeeAndTeaPods = 20
720+ files = []string {
721721 "scale/zero-downtime/cafe.yaml" ,
722722 "scale/zero-downtime/cafe-secret.yaml" ,
723723 "scale/zero-downtime/gateway-1.yaml" ,
@@ -858,12 +858,12 @@ var _ = Describe("Zero downtime scale test", Ordered, Label("nfr", "zero-downtim
858858 numReplicas int
859859 }{
860860 {
861- name : "One NGF Pod runs per node" ,
861+ name : "One NGINX Pod runs per node" ,
862862 valuesFile : "manifests/scale/zero-downtime/values-affinity.yaml" ,
863863 numReplicas : 12 , // equals number of nodes
864864 },
865865 {
866- name : "Multiple NGF Pods run per node" ,
866+ name : "Multiple NGINX Pods run per node" ,
867867 valuesFile : "manifests/scale/zero-downtime/values.yaml" ,
868868 numReplicas : 24 , // twice the number of nodes
869869 },
@@ -876,18 +876,15 @@ var _ = Describe("Zero downtime scale test", Ordered, Label("nfr", "zero-downtim
876876 cfg .nfr = true
877877 setup (cfg , "--values" , test .valuesFile )
878878
879- deploy , err := resourceManager .GetNGFDeployment (ngfNamespace , releaseName )
880- Expect (err ).ToNot (HaveOccurred ())
881- ngfDeploymentName = deploy .GetName ()
882-
883879 Expect (resourceManager .Apply ([]client.Object {& ns })).To (Succeed ())
884880 Expect (resourceManager .ApplyFromFiles (files , ns .Name )).To (Succeed ())
885881 Expect (resourceManager .WaitForAppsToBeReady (ns .Name )).To (Succeed ())
886882
887883 var nginxPodNames []string
884+ var err error
888885 Eventually (
889886 func () bool {
890- nginxPodNames , err : = framework .GetReadyNginxPodNames (k8sClient , ns .Name , timeoutConfig .GetTimeout )
887+ nginxPodNames , err = framework .GetReadyNginxPodNames (k8sClient , ns .Name , timeoutConfig .GetTimeout )
891888 return len (nginxPodNames ) == 1 && err == nil
892889 }).
893890 WithTimeout (timeoutConfig .CreateTimeout ).
@@ -931,8 +928,8 @@ var _ = Describe("Zero downtime scale test", Ordered, Label("nfr", "zero-downtim
931928
932929 // scale NGF up one at a time
933930 for i := 2 ; i <= test .numReplicas ; i ++ {
934- Eventually (resourceManager .ScaleDeployment ).
935- WithArguments (ngfNamespace , ngfDeploymentName , int32 (i )).
931+ Eventually (resourceManager .ScaleNginxDeployment ).
932+ WithArguments (ngfNamespace , releaseName , int32 (i )).
936933 WithTimeout (timeoutConfig .UpdateTimeout ).
937934 WithPolling (500 * time .Millisecond ).
938935 Should (Succeed ())
@@ -942,7 +939,7 @@ var _ = Describe("Zero downtime scale test", Ordered, Label("nfr", "zero-downtim
942939
943940 ctx , cancel := context .WithTimeout (context .Background (), timeoutConfig .UpdateTimeout )
944941
945- Expect (resourceManager .WaitForPodsToBeReadyWithCount (ctx , ngfNamespace , i )).To (Succeed ())
942+ Expect (resourceManager .WaitForPodsToBeReadyWithCount (ctx , ns . Name , i + numCoffeeAndTeaPods )).To (Succeed ())
946943 Expect (resourceManager .WaitForGatewayObservedGeneration (ctx , ns .Name , "gateway" , i )).To (Succeed ())
947944
948945 cancel ()
@@ -984,8 +981,8 @@ var _ = Describe("Zero downtime scale test", Ordered, Label("nfr", "zero-downtim
984981 // scale NGF down one at a time
985982 currentGen := test .numReplicas
986983 for i := test .numReplicas - 1 ; i >= 1 ; i -- {
987- Eventually (resourceManager .ScaleDeployment ).
988- WithArguments (ngfNamespace , ngfDeploymentName , int32 (i )).
984+ Eventually (resourceManager .ScaleNginxDeployment ).
985+ WithArguments (ngfNamespace , releaseName , int32 (i )).
989986 WithTimeout (timeoutConfig .UpdateTimeout ).
990987 WithPolling (500 * time .Millisecond ).
991988 Should (Succeed ())
@@ -994,7 +991,12 @@ var _ = Describe("Zero downtime scale test", Ordered, Label("nfr", "zero-downtim
994991 Expect (resourceManager .ApplyFromFiles ([]string {gatewayFile }, ns .Name )).To (Succeed ())
995992 currentGen ++
996993
994+ ctx , cancel := context .WithTimeout (context .Background (), timeoutConfig .UpdateTimeout )
995+
997996 time .Sleep (terminationTime )
997+ Expect (resourceManager .WaitForGatewayObservedGeneration (ctx , ns .Name , "gateway" , currentGen )).To (Succeed ())
998+
999+ cancel ()
9981000 }
9991001
10001002 wg .Wait ()
@@ -1049,7 +1051,7 @@ var _ = Describe("Zero downtime scale test", Ordered, Label("nfr", "zero-downtim
10491051 // allow traffic flow to start
10501052 time .Sleep (2 * time .Second )
10511053
1052- Expect (resourceManager .ScaleDeployment (ngfNamespace , ngfDeploymentName , int32 (test .numReplicas ))).To (Succeed ())
1054+ Expect (resourceManager .ScaleNginxDeployment (ngfNamespace , releaseName , int32 (test .numReplicas ))).To (Succeed ())
10531055 Expect (resourceManager .ApplyFromFiles ([]string {"scale/zero-downtime/gateway-2.yaml" }, ns .Name )).To (Succeed ())
10541056 checkGatewayListeners (3 )
10551057
@@ -1081,7 +1083,7 @@ var _ = Describe("Zero downtime scale test", Ordered, Label("nfr", "zero-downtim
10811083 // allow traffic flow to start
10821084 time .Sleep (2 * time .Second )
10831085
1084- Expect (resourceManager .ScaleDeployment (ngfNamespace , ngfDeploymentName , int32 (1 ))).To (Succeed ())
1086+ Expect (resourceManager .ScaleNginxDeployment (ngfNamespace , releaseName , int32 (1 ))).To (Succeed ())
10851087 Expect (resourceManager .ApplyFromFiles ([]string {"scale/zero-downtime/gateway-1.yaml" }, ns .Name )).To (Succeed ())
10861088 checkGatewayListeners (2 )
10871089
0 commit comments