Skip to content

Commit 9278ddd

Browse files
authored
Merge pull request #8625 from chrischdi/pr/e2e-runtimesdk-increase-timeout
🐛 test/e2e check for machines being ready after provisioning on Runtime SDK test
2 parents eb8eaba + 642e16c commit 9278ddd

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/e2e/cluster_upgrade_runtimesdk.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,30 @@ func clusterUpgradeWithRuntimeSDKSpec(ctx context.Context, inputGetter func() cl
169169
clusterRef,
170170
input.E2EConfig.GetIntervals(specName, "wait-cluster"))
171171
},
172+
PostMachinesProvisioned: func() {
173+
Eventually(func() error {
174+
// Before running the BeforeClusterUpgrade hook, the topology controller
175+
// checks if the ControlPlane `IsScaling()` and for MachineDeployments if
176+
// `IsAnyRollingOut()`.
177+
// This PostMachineProvisioned function ensures that the clusters machines
178+
// are healthy by checking the MachineNodeHealthyCondition, so the upgrade
179+
// below does not get delayed or runs into timeouts before even reaching
180+
// the BeforeClusterUpgrade hook.
181+
machineList := &clusterv1.MachineList{}
182+
if err := input.BootstrapClusterProxy.GetClient().List(ctx, machineList, client.InNamespace(namespace.Name)); err != nil {
183+
return errors.Wrap(err, "list machines")
184+
}
185+
186+
for i := range machineList.Items {
187+
machine := &machineList.Items[i]
188+
if !conditions.IsTrue(machine, clusterv1.MachineNodeHealthyCondition) {
189+
return errors.Errorf("machine %q does not have %q condition set to true", machine.GetName(), clusterv1.MachineNodeHealthyCondition)
190+
}
191+
}
192+
193+
return nil
194+
}, 5*time.Minute, 15*time.Second).Should(Succeed(), "Waiting for rollouts to finish")
195+
},
172196
WaitForClusterIntervals: input.E2EConfig.GetIntervals(specName, "wait-cluster"),
173197
WaitForControlPlaneIntervals: input.E2EConfig.GetIntervals(specName, "wait-control-plane"),
174198
WaitForMachineDeployments: input.E2EConfig.GetIntervals(specName, "wait-worker-nodes"),

0 commit comments

Comments
 (0)