Skip to content

Commit 08ca061

Browse files
wait for condition update (#2510)
Signed-off-by: akihikokuroda <[email protected]>
1 parent 6f74503 commit 08ca061

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

test/e2e/installplan_e2e_test.go

+12-6
Original file line numberDiff line numberDiff line change
@@ -3192,14 +3192,20 @@ var _ = Describe("Install Plan", func() {
31923192

31933193
It("should clear clear up the condition in the InstallPlan status that contains an error message when a valid OperatorGroup is created", func() {
31943194

3195-
// first check that a condition with a message exists
3196-
fetchedInstallPlan, err := fetchInstallPlanWithNamespace(GinkgoT(), crc, installPlanName, ns.GetName(), buildInstallPlanPhaseCheckFunc(operatorsv1alpha1.InstallPlanPhaseInstalling))
3197-
Expect(err).NotTo(HaveOccurred())
3198-
Expect(fetchedInstallPlan).NotTo(BeNil())
3195+
// first wait for a condition with a message exists
31993196
cond := operatorsv1alpha1.InstallPlanCondition{Type: operatorsv1alpha1.InstallPlanInstalled, Status: corev1.ConditionFalse, Reason: operatorsv1alpha1.InstallPlanReasonInstallCheckFailed,
32003197
Message: "no operator group found that is managing this namespace"}
3201-
Expect(fetchedInstallPlan.Status.Phase).To(Equal(operatorsv1alpha1.InstallPlanPhaseInstalling))
3202-
Expect(hasCondition(fetchedInstallPlan, cond)).To(BeTrue())
3198+
3199+
Eventually(func() bool {
3200+
fetchedInstallPlan, err := fetchInstallPlanWithNamespace(GinkgoT(), crc, installPlanName, ns.GetName(), buildInstallPlanPhaseCheckFunc(operatorsv1alpha1.InstallPlanPhaseInstalling))
3201+
if err != nil || fetchedInstallPlan == nil{
3202+
return false
3203+
}
3204+
if fetchedInstallPlan.Status.Phase != operatorsv1alpha1.InstallPlanPhaseInstalling {
3205+
return false
3206+
}
3207+
return hasCondition(fetchedInstallPlan, cond)
3208+
}, 5*time.Minute, interval).Should(BeTrue())
32033209

32043210
// Create an operatorgroup for the same namespace
32053211
og := &operatorsv1.OperatorGroup{

0 commit comments

Comments
 (0)