From deaa7ae03c7e39491ddba1ca4932f6389cc0d30d Mon Sep 17 00:00:00 2001 From: Alex Leites <18728999+tallaxes@users.noreply.github.com> Date: Thu, 16 Jan 2025 07:12:37 +0000 Subject: [PATCH] test: deflake by waiting for healthy pods --- test/suites/drift/suite_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/suites/drift/suite_test.go b/test/suites/drift/suite_test.go index dc02f1021..e066d3955 100644 --- a/test/suites/drift/suite_test.go +++ b/test/suites/drift/suite_test.go @@ -580,11 +580,13 @@ var _ = Describe("Drift", func() { }, }, }) + selector = labels.SelectorFromSet(dep.Spec.Selector.MatchLabels) env.ExpectCreated(dep, nodeClass, nodePool) By("deploying multiple replicas, pod per node") startingNodeClaimState := env.EventuallyExpectCreatedNodeClaimCount("==", int(numPods)) env.EventuallyExpectCreatedNodeCount("==", int(numPods)) + env.EventuallyExpectHealthyPodCount(selector, int(numPods)) By("drifting the nodeClaim with bad configuration that never registers") nodeClass.Spec.VNETSubnetID = lo.ToPtr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/sillygeese/providers/Microsoft.Network/virtualNetworks/karpenter/subnets/nodeclassSubnet2") @@ -626,11 +628,13 @@ var _ = Describe("Drift", func() { }, }, }) + selector = labels.SelectorFromSet(dep.Spec.Selector.MatchLabels) env.ExpectCreated(dep, nodeClass, nodePool) By("deploying multiple replicas, pod per node") startingNodeClaimState := env.EventuallyExpectCreatedNodeClaimCount("==", int(numPods)) env.EventuallyExpectCreatedNodeCount("==", int(numPods)) + env.EventuallyExpectHealthyPodCount(selector, int(numPods)) By("drifting the nodeClaim with bad configuration that never initializes") nodePool.Spec.Template.Spec.StartupTaints = []corev1.Taint{{Key: "example.com/taint", Effect: corev1.TaintEffectPreferNoSchedule}}