Skip to content

Commit cdafce2

Browse files
committed
fix(e2e): restore synchronization in multi-VA saturation test
The multi-VA saturation test was failing with a 10-minute timeout because the "waiting for CurrentAlloc" step had its assertions commented out when CurrentAlloc was removed from the API (commit db784e3). Without the assertions, the test raced against the optimization loop: 1. Test created deployments and VAs 2. "waiting for CurrentAlloc" step passed immediately (no assertions) 3. Test checked DesiredOptimizedAlloc.NumReplicas before it was populated 4. Timeout after 10 minutes waiting for a value that was never set Fix: Replace the commented-out CurrentAlloc assertions with DesiredOptimizedAlloc assertions, mirroring what the single-VA test correctly does at lines 275-278. This ensures the optimization loop has successfully processed the VAs before checking their replica counts.
1 parent e40d310 commit cdafce2

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

test/e2e-saturation-based/e2e_saturation_test.go

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ var _ = Describe("Test workload-variant-autoscaler - Saturation Mode - Multiple
728728
// fmt.Sprintf("VariantAutoscaling %s MetricsAvailable condition should be True", vaH100.Name))
729729
// }, 4*time.Minute, 10*time.Second).Should(Succeed())
730730

731-
By("waiting for VariantAutoscalings CurrentAlloc to be populated with metrics data")
731+
By("waiting for VariantAutoscalings DesiredOptimizedAlloc to be populated")
732732
Eventually(func(g Gomega) {
733733
vaA100 := &v1alpha1.VariantAutoscaling{}
734734
err := crClient.Get(ctx, client.ObjectKey{
@@ -737,13 +737,11 @@ var _ = Describe("Test workload-variant-autoscaler - Saturation Mode - Multiple
737737
}, vaA100)
738738
g.Expect(err).NotTo(HaveOccurred(), fmt.Sprintf("Should be able to fetch VariantAutoscaling for: %s", deployNameA100))
739739

740-
// In saturation mode, wait for CurrentAlloc to be populated (no MetricsAvailable condition)
741-
// In saturation mode, wait for CurrentAlloc to be populated (no MetricsAvailable condition)
742-
// CurrentAlloc removed
743-
// g.Expect(vaA100.Status.CurrentAlloc.Accelerator).NotTo(BeEmpty(),
744-
// "CurrentAlloc should be populated with accelerator info")
745-
// g.Expect(vaA100.Status.CurrentAlloc.NumReplicas).To(BeNumerically(">=", 0),
746-
// "CurrentAlloc should have NumReplicas set")
740+
// Wait for DesiredOptimizedAlloc to be populated (ensures reconciliation loop is active)
741+
g.Expect(vaA100.Status.DesiredOptimizedAlloc.Accelerator).NotTo(BeEmpty(),
742+
"DesiredOptimizedAlloc should be populated with accelerator info")
743+
g.Expect(vaA100.Status.DesiredOptimizedAlloc.NumReplicas).To(BeNumerically(">=", 0),
744+
"DesiredOptimizedAlloc should have NumReplicas set")
747745
}, 5*time.Minute, 10*time.Second).Should(Succeed())
748746

749747
Eventually(func(g Gomega) {
@@ -754,12 +752,11 @@ var _ = Describe("Test workload-variant-autoscaler - Saturation Mode - Multiple
754752
}, vaH100)
755753
g.Expect(err).NotTo(HaveOccurred(), fmt.Sprintf("Should be able to fetch VariantAutoscaling for: %s", deployNameH100))
756754

757-
// In saturation mode, wait for CurrentAlloc to be populated (no MetricsAvailable condition)
758-
// CurrentAlloc removed
759-
// g.Expect(vaH100.Status.CurrentAlloc.Accelerator).NotTo(BeEmpty(),
760-
// "CurrentAlloc should be populated with accelerator info")
761-
// g.Expect(vaH100.Status.CurrentAlloc.NumReplicas).To(BeNumerically(">=", 0),
762-
// "CurrentAlloc should have NumReplicas set")
755+
// Wait for DesiredOptimizedAlloc to be populated (ensures reconciliation loop is active)
756+
g.Expect(vaH100.Status.DesiredOptimizedAlloc.Accelerator).NotTo(BeEmpty(),
757+
"DesiredOptimizedAlloc should be populated with accelerator info")
758+
g.Expect(vaH100.Status.DesiredOptimizedAlloc.NumReplicas).To(BeNumerically(">=", 0),
759+
"DesiredOptimizedAlloc should have NumReplicas set")
763760
}, 10*time.Minute, 10*time.Second).Should(Succeed())
764761

765762
By("verifying A100 variant has expected initial replicas or scales down (before load)")

0 commit comments

Comments
 (0)