@@ -134,8 +134,10 @@ func testAccurateScaling(ctx context.Context, t *testing.T, kc *kubernetes.Clien
134134
135135 // Base case (number of scale = maxScale since pendingJobs = 0)
136136 enqueueMessages (ctx , t , client , 4 )
137- assert .True (t , WaitForRunningPodCount (t , kc , scaledJobName , testNamespace , 4 , iterationCount , 1 ),
137+ assert .True (t , WaitForScaledJobCount (t , kc , scaledJobName , testNamespace , 4 , iterationCount , 1 ),
138138 "job count should be %d after %d iterations" , 4 , iterationCount )
139+ assert .True (t , WaitForAllPodRunningInNamespace (t , kc , testNamespace , iterationCount , 1 ),
140+ "all scaledjob pods should be running after %d iterations" , iterationCount )
139141
140142 // Clear the queue to simulate message consumption and wait for job completion
141143 _ , err := client .ClearMessages (ctx , nil )
@@ -144,17 +146,21 @@ func testAccurateScaling(ctx context.Context, t *testing.T, kc *kubernetes.Clien
144146
145147 // Test the cap condition (maxScale + runningJobs > maxReplicaCount)
146148 enqueueMessages (ctx , t , client , 4 )
147- assert .True (t , WaitForRunningPodCount (t , kc , scaledJobName , testNamespace , 4 , iterationCount , 1 ),
149+ assert .True (t , WaitForScaledJobCount (t , kc , scaledJobName , testNamespace , 4 , iterationCount , 1 ),
148150 "running job count should be %d after %d iterations" , 4 , iterationCount )
151+ assert .True (t , WaitForAllPodRunningInNamespace (t , kc , testNamespace , iterationCount , 1 ),
152+ "all scaledjob pods should be running after %d iterations" , iterationCount )
149153
150154 // Clear the messages to simulate message consumption
151155 _ , err = client .ClearMessages (ctx , nil )
152156 assert .NoErrorf (t , err , "cannot clear queue - %s" , err )
153157
154158 // Queue up 8 more messages to trigger the cap condition
155159 enqueueMessages (ctx , t , client , 8 )
156- assert .True (t , WaitForRunningPodCount (t , kc , scaledJobName , testNamespace , 10 , iterationCount , 1 ),
160+ assert .True (t , WaitForScaledJobCount (t , kc , scaledJobName , testNamespace , 10 , iterationCount , 1 ),
157161 "running job count should be %d after %d iterations" , 10 , iterationCount )
162+ assert .True (t , WaitForAllPodRunningInNamespace (t , kc , testNamespace , iterationCount , 1 ),
163+ "all scaledjob pods should be running after %d iterations" , iterationCount )
158164
159165 // Message cleanup and wait for jobs to complete
160166 _ , err = client .ClearMessages (ctx , nil )
0 commit comments