Skip to content

Commit

Permalink
Merge pull request #3114 from chrischdi/pr-test-ownerrefs-wait-nodehe…
Browse files Browse the repository at this point in the history
…althy

🌱 test: wait for nodes being ready before testing resource versions being stable
  • Loading branch information
k8s-ci-robot authored Jul 23, 2024
2 parents 7194e3a + e131359 commit 030a53e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/e2e/ownerrefs_finalizers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import (
addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1"
capi_e2e "sigs.k8s.io/cluster-api/test/e2e"
"sigs.k8s.io/cluster-api/test/framework"
"sigs.k8s.io/cluster-api/util/conditions"
"sigs.k8s.io/cluster-api/util/patch"
ctrlclient "sigs.k8s.io/controller-runtime/pkg/client"

Expand Down Expand Up @@ -131,6 +132,23 @@ var _ = Describe("Ensure OwnerReferences and Finalizers are resilient [vcsim] [s
forceCancelFunc()
}

// This check ensures that the rollout to the machines finished before
// checking resource version stability.
Eventually(func() error {
machineList := &clusterv1.MachineList{}
if err := proxy.GetClient().List(ctx, machineList, ctrlclient.InNamespace(namespace)); err != nil {
return errors.Wrap(err, "list machines")
}

for _, machine := range machineList.Items {
if !conditions.IsTrue(&machine, clusterv1.MachineNodeHealthyCondition) {
return errors.Errorf("machine %q does not have %q condition set to true", machine.GetName(), clusterv1.MachineNodeHealthyCondition)
}
}

return nil
}, 5*time.Minute, 15*time.Second).Should(Succeed(), "Waiting for nodes to be ready")

// This check ensures that the resourceVersions are stable, i.e. it verifies there are no
// continuous reconciles when everything should be stable.
// Note: we are not checking resourceVersions on VirtualMachine (reconciled by VM-Operator)
Expand Down

0 comments on commit 030a53e

Please sign in to comment.