@@ -94,23 +94,14 @@ func commonchecks(client *rancher.Client, cluster *management.Cluster) {
9494 By ("downgrading the chart version" , func () {
9595 helpers .DowngradeProviderChart (downgradedVersion )
9696 })
97+
9798 configNodeGroups := * cluster .EKSConfig .NodeGroups
9899 initialNodeCount := * configNodeGroups [0 ].DesiredSize
99- var upgradeSuccessful bool
100100
101101 By ("making a change(scaling nodegroup up) to the cluster to validate functionality after chart downgrade" , func () {
102102 var err error
103- cluster , err = helper .ScaleNodeGroup (cluster , client , initialNodeCount + increaseBy , false , true )
103+ cluster , err = helper .ScaleNodeGroup (cluster , client , initialNodeCount + increaseBy , true , true )
104104 Expect (err ).To (BeNil ())
105-
106- // We do not use WaitClusterToBeUpgraded because it has been flaky here and times out
107- Eventually (func () bool {
108- configNodeGroups = * cluster .EKSConfig .NodeGroups
109- for i := range configNodeGroups {
110- upgradeSuccessful = * configNodeGroups [i ].DesiredSize == initialNodeCount + increaseBy
111- }
112- return upgradeSuccessful
113- }, tools .SetTimeout (15 * time .Minute ), 10 * time .Second ).Should (BeTrue ())
114105 })
115106
116107 By ("uninstalling the operator chart" , func () {
@@ -134,11 +125,14 @@ func commonchecks(client *rancher.Client, cluster *management.Cluster) {
134125 Eventually (func () bool {
135126 GinkgoLogr .Info ("Waiting for the node count change to appear in EKSStatus.UpstreamSpec ..." )
136127 Expect (err ).To (BeNil ())
137- upstreamNodeGroups := * cluster .EKSStatus .UpstreamSpec .NodeGroups
138- for i := range upstreamNodeGroups {
139- upgradeSuccessful = * upstreamNodeGroups [i ].DesiredSize == initialNodeCount
128+ cluster , err = client .Management .Cluster .ByID (cluster .ID )
129+ Expect (err ).To (BeNil ())
130+ for _ , ng := range * cluster .EKSStatus .UpstreamSpec .NodeGroups {
131+ if * ng .DesiredSize != initialNodeCount {
132+ return false
133+ }
140134 }
141- return upgradeSuccessful
135+ return true
142136 }, tools .SetTimeout (15 * time .Minute ), 10 * time .Second ).Should (BeTrue ())
143137
144138 })
0 commit comments