Skip to content

Commit a9945c6

Browse files
author
Arvind Thirumurugan
committed
test changes to identify falky behavior
1 parent 4950abc commit a9945c6

File tree

2 files changed

+66
-16
lines changed

2 files changed

+66
-16
lines changed

test/e2e/placement_eviction_test.go

Lines changed: 55 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
testutilseviction "go.goms.io/fleet/test/utils/eviction"
2121
)
2222

23-
var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickFixed CRP, invalid eviction denied - No PDB specified", Ordered, func() {
23+
var _ = FDescribe("ClusterResourcePlacement eviction of bound binding - PickFixed CRP, invalid eviction denied - No PDB specified", Ordered, func() {
2424
crpName := fmt.Sprintf(crpNameTemplate, GinkgoParallelProcess())
2525
crpEvictionName := fmt.Sprintf(crpEvictionNameTemplate, GinkgoParallelProcess())
2626

@@ -88,7 +88,7 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickFixed
8888
It("should still place resources on the all available member clusters", checkIfPlacedWorkResourcesOnAllMemberClusters)
8989
})
9090

91-
var _ = Describe("ClusterResourcePlacement eviction of bound binding, taint cluster before eviction - No PDB specified", Ordered, Serial, func() {
91+
var _ = FDescribe("ClusterResourcePlacement eviction of bound binding, taint cluster before eviction - No PDB specified", Ordered, Serial, func() {
9292
crpName := fmt.Sprintf(crpNameTemplate, GinkgoParallelProcess())
9393
crpEvictionName := fmt.Sprintf(crpEvictionNameTemplate, GinkgoParallelProcess())
9494
var taintClusterNames, noTaintClusterNames []string
@@ -165,7 +165,7 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding, taint clus
165165
})
166166
})
167167

168-
var _ = Describe("ClusterResourcePlacement eviction of bound binding, no taint specified, evicted cluster is picked again by scheduler - No PDB specified", Ordered, func() {
168+
var _ = FDescribe("ClusterResourcePlacement eviction of bound binding, no taint specified, evicted cluster is picked again by scheduler - No PDB specified", Ordered, func() {
169169
crpName := fmt.Sprintf(crpNameTemplate, GinkgoParallelProcess())
170170
crpEvictionName := fmt.Sprintf(crpEvictionNameTemplate, GinkgoParallelProcess())
171171

@@ -218,7 +218,7 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding, no taint s
218218
It("should still place resources on the all available member clusters", checkIfPlacedWorkResourcesOnAllMemberClusters)
219219
})
220220

221-
var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickAll CRP, PDB with MaxUnavailable set as Integer, eviction denied due to misconfigured PDB", Ordered, func() {
221+
var _ = FDescribe("ClusterResourcePlacement eviction of bound binding - PickAll CRP, PDB with MaxUnavailable set as Integer, eviction denied due to misconfigured PDB", Ordered, func() {
222222
crpName := fmt.Sprintf(crpNameTemplate, GinkgoParallelProcess())
223223
crpEvictionName := fmt.Sprintf(crpEvictionNameTemplate, GinkgoParallelProcess())
224224

@@ -259,6 +259,9 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickAll C
259259
})
260260

261261
It("create cluster resource placement eviction targeting member cluster 1", func() {
262+
ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
263+
Eventually(ensureCRPDisruptionBudgetExists, eventuallyDuration, eventuallyInterval).Should(BeTrue(), "Failed to ensure CRP Disruption Budget exists")
264+
262265
crpe := &placementv1alpha1.ClusterResourcePlacementEviction{
263266
ObjectMeta: metav1.ObjectMeta{
264267
Name: crpEvictionName,
@@ -287,7 +290,7 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickAll C
287290
It("should still place resources on the all available member clusters", checkIfPlacedWorkResourcesOnAllMemberClusters)
288291
})
289292

290-
var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickAll CRP, PDB with MaxUnavailable set as Percentage, eviction denied due to misconfigured PDB", Ordered, func() {
293+
var _ = FDescribe("ClusterResourcePlacement eviction of bound binding - PickAll CRP, PDB with MaxUnavailable set as Percentage, eviction denied due to misconfigured PDB", Ordered, func() {
291294
crpName := fmt.Sprintf(crpNameTemplate, GinkgoParallelProcess())
292295
crpEvictionName := fmt.Sprintf(crpEvictionNameTemplate, GinkgoParallelProcess())
293296

@@ -328,6 +331,9 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickAll C
328331
})
329332

330333
It("create cluster resource placement eviction targeting member cluster 1", func() {
334+
ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
335+
Eventually(ensureCRPDisruptionBudgetExists, eventuallyDuration, eventuallyInterval).Should(BeTrue(), "Failed to ensure CRP Disruption Budget exists")
336+
331337
crpe := &placementv1alpha1.ClusterResourcePlacementEviction{
332338
ObjectMeta: metav1.ObjectMeta{
333339
Name: crpEvictionName,
@@ -356,7 +362,7 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickAll C
356362
It("should still place resources on the all available member clusters", checkIfPlacedWorkResourcesOnAllMemberClusters)
357363
})
358364

359-
var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickAll CRP, PDB with MinAvailable set as Percentage, eviction denied due to misconfigured PDB", Ordered, func() {
365+
var _ = FDescribe("ClusterResourcePlacement eviction of bound binding - PickAll CRP, PDB with MinAvailable set as Percentage, eviction denied due to misconfigured PDB", Ordered, func() {
360366
crpName := fmt.Sprintf(crpNameTemplate, GinkgoParallelProcess())
361367
crpEvictionName := fmt.Sprintf(crpEvictionNameTemplate, GinkgoParallelProcess())
362368

@@ -397,6 +403,9 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickAll C
397403
})
398404

399405
It("create cluster resource placement eviction targeting member cluster 1", func() {
406+
ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
407+
Eventually(ensureCRPDisruptionBudgetExists, eventuallyDuration, eventuallyInterval).Should(BeTrue(), "Failed to ensure CRP Disruption Budget exists")
408+
400409
crpe := &placementv1alpha1.ClusterResourcePlacementEviction{
401410
ObjectMeta: metav1.ObjectMeta{
402411
Name: crpEvictionName,
@@ -425,7 +434,7 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickAll C
425434
It("should still place resources on the all available member clusters", checkIfPlacedWorkResourcesOnAllMemberClusters)
426435
})
427436

428-
var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickAll CRP, PDB with MinAvailable specified as Integer to protect resources on all clusters, eviction denied", Ordered, func() {
437+
var _ = FDescribe("ClusterResourcePlacement eviction of bound binding - PickAll CRP, PDB with MinAvailable specified as Integer to protect resources on all clusters, eviction denied", Ordered, func() {
429438
crpName := fmt.Sprintf(crpNameTemplate, GinkgoParallelProcess())
430439
crpEvictionName := fmt.Sprintf(crpEvictionNameTemplate, GinkgoParallelProcess())
431440

@@ -466,6 +475,9 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickAll C
466475
})
467476

468477
It("create cluster resource placement eviction targeting member cluster 1", func() {
478+
ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
479+
Eventually(ensureCRPDisruptionBudgetExists, eventuallyDuration, eventuallyInterval).Should(BeTrue(), "Failed to ensure CRP Disruption Budget exists")
480+
469481
crpe := &placementv1alpha1.ClusterResourcePlacementEviction{
470482
ObjectMeta: metav1.ObjectMeta{
471483
Name: crpEvictionName,
@@ -494,7 +506,7 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickAll C
494506
It("should still place resources on the all available member clusters", checkIfPlacedWorkResourcesOnAllMemberClusters)
495507
})
496508

497-
var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickAll CRP, PDB with MinAvailable specified as Integer to protect resources in all but one cluster, eviction allowed", Ordered, Serial, func() {
509+
var _ = FDescribe("ClusterResourcePlacement eviction of bound binding - PickAll CRP, PDB with MinAvailable specified as Integer to protect resources in all but one cluster, eviction allowed", Ordered, Serial, func() {
498510
crpName := fmt.Sprintf(crpNameTemplate, GinkgoParallelProcess())
499511
crpEvictionName := fmt.Sprintf(crpEvictionNameTemplate, GinkgoParallelProcess())
500512
var taintClusterNames, noTaintClusterNames []string
@@ -544,6 +556,9 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickAll C
544556
})
545557

546558
It("create cluster resource placement eviction targeting member cluster 1", func() {
559+
ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
560+
Eventually(ensureCRPDisruptionBudgetExists, eventuallyDuration, eventuallyInterval).Should(BeTrue(), "Failed to ensure CRP Disruption Budget exists")
561+
547562
crpe := &placementv1alpha1.ClusterResourcePlacementEviction{
548563
ObjectMeta: metav1.ObjectMeta{
549564
Name: crpEvictionName,
@@ -586,7 +601,7 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickAll C
586601
})
587602
})
588603

589-
var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP, PDB with MaxUnavailable specified as Integer to protect resources on all clusters, eviction denied", Ordered, func() {
604+
var _ = FDescribe("ClusterResourcePlacement eviction of bound binding - PickN CRP, PDB with MaxUnavailable specified as Integer to protect resources on all clusters, eviction denied", Ordered, func() {
590605
crpName := fmt.Sprintf(crpNameTemplate, GinkgoParallelProcess())
591606
crpEvictionName := fmt.Sprintf(crpEvictionNameTemplate, GinkgoParallelProcess())
592607

@@ -642,6 +657,9 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP
642657
})
643658

644659
It("create cluster resource placement eviction targeting member cluster 1", func() {
660+
ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
661+
Eventually(ensureCRPDisruptionBudgetExists, eventuallyDuration, eventuallyInterval).Should(BeTrue(), "Failed to ensure CRP Disruption Budget exists")
662+
645663
crpe := &placementv1alpha1.ClusterResourcePlacementEviction{
646664
ObjectMeta: metav1.ObjectMeta{
647665
Name: crpEvictionName,
@@ -670,7 +688,7 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP
670688
It("should still place resources on the all available member clusters", checkIfPlacedWorkResourcesOnAllMemberClusters)
671689
})
672690

673-
var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP, PDB with MaxUnavailable specified as Integer to protect resources all clusters but one cluster, eviction allowed", Ordered, Serial, func() {
691+
var _ = FDescribe("ClusterResourcePlacement eviction of bound binding - PickN CRP, PDB with MaxUnavailable specified as Integer to protect resources all clusters but one cluster, eviction allowed", Ordered, Serial, func() {
674692
crpName := fmt.Sprintf(crpNameTemplate, GinkgoParallelProcess())
675693
crpEvictionName := fmt.Sprintf(crpEvictionNameTemplate, GinkgoParallelProcess())
676694
var taintClusterNames, noTaintClusterNames []string
@@ -735,6 +753,9 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP
735753
})
736754

737755
It("create cluster resource placement eviction targeting member cluster 1", func() {
756+
ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
757+
Eventually(ensureCRPDisruptionBudgetExists, eventuallyDuration, eventuallyInterval).Should(BeTrue(), "Failed to ensure CRP Disruption Budget exists")
758+
738759
crpe := &placementv1alpha1.ClusterResourcePlacementEviction{
739760
ObjectMeta: metav1.ObjectMeta{
740761
Name: crpEvictionName,
@@ -777,7 +798,7 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP
777798
})
778799
})
779800

780-
var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP, PDB with MaxUnavailable specified as percentage to protect all clusters but one, eviction allowed", Ordered, Serial, func() {
801+
var _ = FDescribe("ClusterResourcePlacement eviction of bound binding - PickN CRP, PDB with MaxUnavailable specified as percentage to protect all clusters but one, eviction allowed", Ordered, Serial, func() {
781802
crpName := fmt.Sprintf(crpNameTemplate, GinkgoParallelProcess())
782803
crpEvictionName := fmt.Sprintf(crpEvictionNameTemplate, GinkgoParallelProcess())
783804
var taintClusterNames, noTaintClusterNames []string
@@ -842,6 +863,9 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP
842863
})
843864

844865
It("create cluster resource placement eviction targeting member cluster 1", func() {
866+
ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
867+
Eventually(ensureCRPDisruptionBudgetExists, eventuallyDuration, eventuallyInterval).Should(BeTrue(), "Failed to ensure CRP Disruption Budget exists")
868+
845869
crpe := &placementv1alpha1.ClusterResourcePlacementEviction{
846870
ObjectMeta: metav1.ObjectMeta{
847871
Name: crpEvictionName,
@@ -884,7 +908,7 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP
884908
})
885909
})
886910

887-
var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP, PDB with MaxUnavailable specified as percentage to protect resources on all clusters, eviction denied", Ordered, func() {
911+
var _ = FDescribe("ClusterResourcePlacement eviction of bound binding - PickN CRP, PDB with MaxUnavailable specified as percentage to protect resources on all clusters, eviction denied", Ordered, func() {
888912
crpName := fmt.Sprintf(crpNameTemplate, GinkgoParallelProcess())
889913
crpEvictionName := fmt.Sprintf(crpEvictionNameTemplate, GinkgoParallelProcess())
890914

@@ -940,6 +964,9 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP
940964
})
941965

942966
It("create cluster resource placement eviction targeting member cluster 1", func() {
967+
ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
968+
Eventually(ensureCRPDisruptionBudgetExists, eventuallyDuration, eventuallyInterval).Should(BeTrue(), "Failed to ensure CRP Disruption Budget exists")
969+
943970
crpe := &placementv1alpha1.ClusterResourcePlacementEviction{
944971
ObjectMeta: metav1.ObjectMeta{
945972
Name: crpEvictionName,
@@ -976,7 +1003,7 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP
9761003
It("should still place resources on the all available member clusters", checkIfPlacedWorkResourcesOnAllMemberClusters)
9771004
})
9781005

979-
var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP, PDB with MinAvailable specified as Integer to protect resources on all clusters, eviction denied", Ordered, func() {
1006+
var _ = FDescribe("ClusterResourcePlacement eviction of bound binding - PickN CRP, PDB with MinAvailable specified as Integer to protect resources on all clusters, eviction denied", Ordered, func() {
9801007
crpName := fmt.Sprintf(crpNameTemplate, GinkgoParallelProcess())
9811008
crpEvictionName := fmt.Sprintf(crpEvictionNameTemplate, GinkgoParallelProcess())
9821009

@@ -1032,6 +1059,9 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP
10321059
})
10331060

10341061
It("create cluster resource placement eviction targeting member cluster 1", func() {
1062+
ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
1063+
Eventually(ensureCRPDisruptionBudgetExists, eventuallyDuration, eventuallyInterval).Should(BeTrue(), "Failed to ensure CRP Disruption Budget exists")
1064+
10351065
crpe := &placementv1alpha1.ClusterResourcePlacementEviction{
10361066
ObjectMeta: metav1.ObjectMeta{
10371067
Name: crpEvictionName,
@@ -1060,7 +1090,7 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP
10601090
It("should still place resources on the all available member clusters", checkIfPlacedWorkResourcesOnAllMemberClusters)
10611091
})
10621092

1063-
var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP, PDB with MinAvailable specified as Integer to protect resources all clusters but one cluster, eviction allowed", Ordered, Serial, func() {
1093+
var _ = FDescribe("ClusterResourcePlacement eviction of bound binding - PickN CRP, PDB with MinAvailable specified as Integer to protect resources all clusters but one cluster, eviction allowed", Ordered, Serial, func() {
10641094
crpName := fmt.Sprintf(crpNameTemplate, GinkgoParallelProcess())
10651095
crpEvictionName := fmt.Sprintf(crpEvictionNameTemplate, GinkgoParallelProcess())
10661096
var taintClusterNames, noTaintClusterNames []string
@@ -1125,6 +1155,9 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP
11251155
})
11261156

11271157
It("create cluster resource placement eviction targeting member cluster 1", func() {
1158+
ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
1159+
Eventually(ensureCRPDisruptionBudgetExists, eventuallyDuration, eventuallyInterval).Should(BeTrue(), "Failed to ensure CRP Disruption Budget exists")
1160+
11281161
crpe := &placementv1alpha1.ClusterResourcePlacementEviction{
11291162
ObjectMeta: metav1.ObjectMeta{
11301163
Name: crpEvictionName,
@@ -1167,7 +1200,7 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP
11671200
})
11681201
})
11691202

1170-
var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP, PDB with MinAvailable specified as percentage to protect all clusters but one, eviction allowed", Ordered, Serial, func() {
1203+
var _ = FDescribe("ClusterResourcePlacement eviction of bound binding - PickN CRP, PDB with MinAvailable specified as percentage to protect all clusters but one, eviction allowed", Ordered, Serial, func() {
11711204
crpName := fmt.Sprintf(crpNameTemplate, GinkgoParallelProcess())
11721205
crpEvictionName := fmt.Sprintf(crpEvictionNameTemplate, GinkgoParallelProcess())
11731206
var taintClusterNames, noTaintClusterNames []string
@@ -1232,6 +1265,9 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP
12321265
})
12331266

12341267
It("create cluster resource placement eviction targeting member cluster 1", func() {
1268+
ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
1269+
Eventually(ensureCRPDisruptionBudgetExists, eventuallyDuration, eventuallyInterval).Should(BeTrue(), "Failed to ensure CRP Disruption Budget exists")
1270+
12351271
crpe := &placementv1alpha1.ClusterResourcePlacementEviction{
12361272
ObjectMeta: metav1.ObjectMeta{
12371273
Name: crpEvictionName,
@@ -1274,7 +1310,7 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP
12741310
})
12751311
})
12761312

1277-
var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP, PDB with MinAvailable specified as percentage to protect resources on all clusters, eviction denied", Ordered, func() {
1313+
var _ = FDescribe("ClusterResourcePlacement eviction of bound binding - PickN CRP, PDB with MinAvailable specified as percentage to protect resources on all clusters, eviction denied", Ordered, func() {
12781314
crpName := fmt.Sprintf(crpNameTemplate, GinkgoParallelProcess())
12791315
crpEvictionName := fmt.Sprintf(crpEvictionNameTemplate, GinkgoParallelProcess())
12801316

@@ -1330,6 +1366,9 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP
13301366
})
13311367

13321368
It("create cluster resource placement eviction targeting member cluster 1", func() {
1369+
ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
1370+
Eventually(ensureCRPDisruptionBudgetExists, eventuallyDuration, eventuallyInterval).Should(BeTrue(), "Failed to ensure CRP Disruption Budget exists")
1371+
13331372
crpe := &placementv1alpha1.ClusterResourcePlacementEviction{
13341373
ObjectMeta: metav1.ObjectMeta{
13351374
Name: crpEvictionName,

test/e2e/utils_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,17 @@ func ensureCRPEvictionDeleted(crpEvictionName string) {
928928
Eventually(removedActual, eventuallyDuration, eventuallyInterval).Should(Succeed(), "CRP eviction still exists")
929929
}
930930

931+
func ensureCRPDisruptionBudgetExists(crpDisruptionBudgetName string) func() bool {
932+
return func() bool {
933+
crpdb := &placementv1alpha1.ClusterResourcePlacementDisruptionBudget{
934+
ObjectMeta: metav1.ObjectMeta{
935+
Name: crpDisruptionBudgetName,
936+
},
937+
}
938+
return !k8serrors.IsNotFound(hubClient.Get(ctx, types.NamespacedName{Name: crpdb.Name}, crpdb))
939+
}
940+
}
941+
931942
func ensureCRPDisruptionBudgetDeleted(crpDisruptionBudgetName string) {
932943
crpdb := &placementv1alpha1.ClusterResourcePlacementDisruptionBudget{
933944
ObjectMeta: metav1.ObjectMeta{

0 commit comments

Comments
 (0)