Skip to content

Commit e628cd2

Browse files
committed
e2e: change behavior of VerifyMachinesReady to verify once after a successful list of machines
1 parent 2d94bfe commit e628cd2

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

test/framework/cluster_helpers.go

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -496,20 +496,19 @@ func VerifyMachinesReady(ctx context.Context, input VerifyMachinesReadyInput) {
496496
client.MatchingLabels{
497497
clusterv1.ClusterNameLabel: input.Name,
498498
})).To(Succeed())
499-
500-
g.Expect(machineList.Items).ToNot(BeEmpty(), "No machines found for cluster %s", input.Name)
501-
502-
for _, machine := range machineList.Items {
503-
readyConditionFound := false
504-
for _, condition := range machine.Status.Conditions {
505-
if condition.Type == clusterv1.ReadyCondition {
506-
readyConditionFound = true
507-
g.Expect(condition.Status).To(Equal(metav1.ConditionTrue), "The Ready condition on Machine %q should be set to true; message: %s", machine.Name, condition.Message)
508-
g.Expect(condition.Message).To(BeEmpty(), "The Ready condition on Machine %q should have an empty message", machine.Name)
509-
break
510-
}
499+
}, 5*time.Minute, 10*time.Second).Should(Succeed(), "Failed to list Machines to check the Ready condition for Cluster %s", klog.KRef(input.Namespace, input.Name))
500+
501+
Expect(machineList.Items).ToNot(BeEmpty(), "No machines found for cluster %s", input.Name)
502+
for _, machine := range machineList.Items {
503+
readyConditionFound := false
504+
for _, condition := range machine.Status.Conditions {
505+
if condition.Type == clusterv1.ReadyCondition {
506+
readyConditionFound = true
507+
Expect(condition.Status).To(Equal(metav1.ConditionTrue), "The Ready condition on Machine %q should be set to true; message: %s", machine.Name, condition.Message)
508+
Expect(condition.Message).To(BeEmpty(), "The Ready condition on Machine %q should have an empty message", machine.Name)
509+
break
511510
}
512-
g.Expect(readyConditionFound).To(BeTrue(), "Machine %q should have a Ready condition", machine.Name)
513511
}
514-
}, 5*time.Minute, 10*time.Second).Should(Succeed(), "Failed to verify Machines Ready condition for Cluster %s", klog.KRef(input.Namespace, input.Name))
512+
Expect(readyConditionFound).To(BeTrue(), "Machine %q should have a Ready condition", machine.Name)
513+
}
515514
}

0 commit comments

Comments
 (0)