@@ -306,6 +306,7 @@ var _ = ginkgo.Describe("application failover testing", func() {
306306 var policy * policyv1alpha1.PropagationPolicy
307307 var maxGroups , minGroups int
308308 var gracePeriodSeconds , tolerationSeconds int32
309+ var targetClusters []string
309310
310311 ginkgo .BeforeEach (func () {
311312 policyNamespace = testNamespace
@@ -315,6 +316,7 @@ var _ = ginkgo.Describe("application failover testing", func() {
315316 deployment = testhelper .NewDeployment (deploymentNamespace , deploymentName )
316317 maxGroups = 1
317318 minGroups = 1
319+ targetClusters = framework .ClusterNames ()[:2 ]
318320
319321 policy = & policyv1alpha1.PropagationPolicy {
320322 ObjectMeta : metav1.ObjectMeta {
@@ -331,7 +333,7 @@ var _ = ginkgo.Describe("application failover testing", func() {
331333 },
332334 Placement : policyv1alpha1.Placement {
333335 ClusterAffinity : & policyv1alpha1.ClusterAffinity {
334- ClusterNames : framework . ClusterNames ()[: 2 ] ,
336+ ClusterNames : targetClusters ,
335337 },
336338 SpreadConstraints : []policyv1alpha1.SpreadConstraint {
337339 {
@@ -349,6 +351,9 @@ var _ = ginkgo.Describe("application failover testing", func() {
349351 ginkgo .JustBeforeEach (func () {
350352 framework .CreatePropagationPolicy (karmadaClient , policy )
351353 framework .CreateDeployment (kubeClient , deployment )
354+ framework .WaitDeploymentPresentOnClustersFitWith (targetClusters , deployment .Namespace , deployment .Name , func (deployment * appsv1.Deployment ) bool {
355+ return deployment .Status .ReadyReplicas == * deployment .Spec .Replicas
356+ })
352357 ginkgo .DeferCleanup (func () {
353358 framework .RemoveDeployment (kubeClient , deployment .Namespace , deployment .Name )
354359 framework .RemovePropagationPolicy (karmadaClient , policy .Namespace , policy .Name )
0 commit comments