Skip to content

Commit f50d78c

Browse files
committed
wait for condition update
Signed-off-by: akihikokuroda <[email protected]>
1 parent ea00762 commit f50d78c

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

test/e2e/installplan_e2e_test.go

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3192,14 +3192,24 @@ 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+
Eventually(
3199+
func() (bool, error) {
3200+
fetchedInstallPlan, err := fetchInstallPlanWithNamespace(GinkgoT(), crc, installPlanName, ns.GetName(), buildInstallPlanPhaseCheckFunc(operatorsv1alpha1.InstallPlanPhaseInstalling))
3201+
Expect(err).NotTo(HaveOccurred())
3202+
Expect(fetchedInstallPlan).NotTo(BeNil())
3203+
Expect(fetchedInstallPlan.Status.Phase).To(Equal(operatorsv1alpha1.InstallPlanPhaseInstalling))
3204+
if hasCondition(fetchedInstallPlan, cond) {
3205+
return true, nil
3206+
} else {
3207+
return false, nil
3208+
}
3209+
},
3210+
1*time.Minute,
3211+
interval,
3212+
).Should(BeTrue())
32033213

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

0 commit comments

Comments
 (0)