@@ -3192,14 +3192,20 @@ var _ = Describe("Install Plan", func() {
3192
3192
3193
3193
It ("should clear clear up the condition in the InstallPlan status that contains an error message when a valid OperatorGroup is created" , func () {
3194
3194
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
3199
3196
cond := operatorsv1alpha1.InstallPlanCondition {Type : operatorsv1alpha1 .InstallPlanInstalled , Status : corev1 .ConditionFalse , Reason : operatorsv1alpha1 .InstallPlanReasonInstallCheckFailed ,
3200
3197
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 ())
3203
3209
3204
3210
// Create an operatorgroup for the same namespace
3205
3211
og := & operatorsv1.OperatorGroup {
0 commit comments