@@ -183,16 +183,22 @@ func AssertClusterIsReady(namespace string, clusterName string, timeout int, env
183
183
Name : clusterName ,
184
184
}
185
185
// Eventually the number of ready instances should be equal to the
186
- // amount of instances defined in the cluster
186
+ // amount of instances defined in the cluster and
187
+ // the cluster status should be in healthy state
187
188
cluster := & apiv1.Cluster {}
188
189
err := env .Client .Get (env .Ctx , namespacedName , cluster )
189
190
Expect (err ).ToNot (HaveOccurred ())
190
- Eventually (func () (int , error ) {
191
+ Eventually (func () (string , error ) {
191
192
podList , err := env .GetClusterPodList (namespace , clusterName )
192
- Expect (err ).ToNot (HaveOccurred ())
193
- readyInstances := utils .CountReadyPods (podList .Items )
194
- return readyInstances , err
195
- }, timeout ).Should (BeEquivalentTo (cluster .Spec .Instances ))
193
+ if err != nil {
194
+ return "" , err
195
+ }
196
+ if cluster .Spec .Instances == int32 (utils .CountReadyPods (podList .Items )) {
197
+ err = env .Client .Get (env .Ctx , namespacedName , cluster )
198
+ return cluster .Status .Phase , err
199
+ }
200
+ return "" , nil
201
+ }, timeout , 2 ).Should (BeEquivalentTo (apiv1 .PhaseHealthy ))
196
202
})
197
203
}
198
204
@@ -647,7 +653,7 @@ func AssertReplicaModeCluster(
647
653
Eventually (func () error {
648
654
primarySrcCluster , err = env .GetClusterPrimary (namespace , srcClusterName )
649
655
return err
650
- }, 5 ).Should (BeNil ())
656
+ }, 30 , 3 ).Should (BeNil ())
651
657
})
652
658
653
659
By ("creating test data in source cluster" , func () {
@@ -663,7 +669,7 @@ func AssertReplicaModeCluster(
663
669
Eventually (func () error {
664
670
primaryReplicaCluster , err = env .GetClusterPrimary (namespace , replicaClusterName )
665
671
return err
666
- }, 5 ).Should (BeNil ())
672
+ }, 30 , 3 ).Should (BeNil ())
667
673
})
668
674
669
675
By ("verifying that replica cluster primary is in recovery mode" , func () {
0 commit comments