Skip to content

Commit d0bae51

Browse files
committed
5
Signed-off-by: dkarpele <[email protected]>
1 parent fdcf447 commit d0bae51

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

test/ginkgo/fixture/fixture.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,9 @@ func deleteNamespaceAndVerify(ctx context.Context, namespaceParam string, k8sCli
337337
// Delete the namespace:
338338
// - Issue a request to Delete the namespace
339339
// - Finally, we check if it has been deleted.
340-
if err := wait.PollUntilContextTimeout(ctx, time.Second*5, time.Minute*6, true, func(ctx context.Context) (done bool, err error) {
340+
// Using 10 minute timeout to accommodate CI environments with limited resources
341+
// where cleanup operations may take longer due to finalizers on ArgoCD resources.
342+
if err := wait.PollUntilContextTimeout(ctx, time.Second*5, time.Minute*10, true, func(ctx context.Context) (done bool, err error) {
341343
// Delete the namespace, if it exists
342344
namespace := corev1.Namespace{
343345
ObjectMeta: metav1.ObjectMeta{

test/ginkgo/fixture/utils/fixtureUtils.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,5 +125,12 @@ func getSystemKubeConfig() (*rest.Config, error) {
125125
if err != nil {
126126
return nil, err
127127
}
128+
129+
// Increase QPS and Burst to avoid rate limiting issues during cleanup.
130+
// The default values (5 QPS, 10 Burst) can cause "client rate limiter Wait returned an error"
131+
// errors in CI environments with limited resources where cleanup operations are slower.
132+
restConfig.QPS = 50
133+
restConfig.Burst = 100
134+
128135
return restConfig, nil
129136
}

test/ginkgo/parallel/1-001_validate_image_updater_test.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
5050
ns *corev1.Namespace
5151
cleanupFunc func()
5252
imageUpdater *imageUpdaterApi.ImageUpdater
53+
argoCD *argov1beta1api.ArgoCD
5354
)
5455

5556
BeforeEach(func() {
@@ -63,7 +64,16 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
6364
if imageUpdater != nil {
6465
By("deleting ImageUpdater CR")
6566
Expect(k8sClient.Delete(ctx, imageUpdater)).To(Succeed())
66-
Eventually(imageUpdater).Should(k8sFixture.NotExistByName())
67+
Eventually(imageUpdater, "2m", "5s").Should(k8sFixture.NotExistByName())
68+
}
69+
70+
// Delete the ArgoCD CR before namespace deletion to allow the operator
71+
// to properly clean up all managed resources. This prevents finalizer
72+
// issues and rate limiting during cleanup in CI environments.
73+
if argoCD != nil {
74+
By("deleting ArgoCD CR")
75+
Expect(k8sClient.Delete(ctx, argoCD)).To(Succeed())
76+
Eventually(argoCD, "5m", "10s").Should(k8sFixture.NotExistByName())
6777
}
6878

6979
if cleanupFunc != nil {
@@ -79,7 +89,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
7989
By("creating simple namespace-scoped Argo CD instance with image updater enabled")
8090
ns, cleanupFunc = fixture.CreateRandomE2ETestNamespaceWithCleanupFunc()
8191

82-
argoCD := &argov1beta1api.ArgoCD{
92+
argoCD = &argov1beta1api.ArgoCD{
8393
ObjectMeta: metav1.ObjectMeta{Name: "argocd", Namespace: ns.Name},
8494
Spec: argov1beta1api.ArgoCDSpec{
8595
ImageUpdater: argov1beta1api.ArgoCDImageUpdaterSpec{
@@ -181,8 +191,6 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
181191
// Return an empty string to signify the condition is not yet met.
182192
return ""
183193
}, "5m", "10s").Should(Equal("quay.io/dkarpele/my-guestbook:29437546.0"))
184-
185-
Expect(k8sClient.Delete(ctx, imageUpdater)).To(Succeed())
186194
})
187195
})
188196
})

0 commit comments

Comments
 (0)