Skip to content

Commit

Permalink
assisted ztp: use eventually in platform tests
Browse files Browse the repository at this point in the history
  • Loading branch information
trewest committed Sep 27, 2024
1 parent 98a5950 commit 4ae65a3
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions tests/assisted/ztp/operator/tests/platform-selection-test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,21 @@ var _ = Describe(
} else {
Expect(err).ToNot(HaveOccurred(), "error creating agentclusterinstall")
By("Waiting for condition to report expected failure message")
err = testAgentClusterInstall.WaitForConditionMessage(v1beta1.ClusterSpecSyncedCondition,
"The Spec could not be synced due to an input error: "+message, time.Second*10)
Expect(err).NotTo(HaveOccurred(), "got unexpected message from SpecSynced condition")
Eventually(func() (string, error) {
testAgentClusterInstall.Object, err = testAgentClusterInstall.Get()
if err != nil {
return "", err
}

for _, condition := range testAgentClusterInstall.Object.Status.Conditions {
if condition.Type == v1beta1.ClusterSpecSyncedCondition {
return condition.Message, nil
}
}

return "", nil
}).WithTimeout(time.Minute*2).Should(Equal("The Spec could not be synced due to an input error: "+message),
"got unexpected message from SpecSynced condition")
}
},
Entry("that is SNO with VSphere platform", v1beta1.VSpherePlatformType, true, 1, 0,
Expand Down

0 comments on commit 4ae65a3

Please sign in to comment.