Skip to content

Commit 6cc020e

Browse files
committed
remove test
1 parent 79f27d6 commit 6cc020e

File tree

1 file changed

+0
-57
lines changed

1 file changed

+0
-57
lines changed

controllers/routingctrl/controller_test.go

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package routingctrl_test
22

33
import (
44
"context"
5-
"errors"
65
"fmt"
76

87
. "github.com/onsi/ginkgo/v2"
@@ -434,62 +433,6 @@ var _ = Describe("Platform routing setup for the component", test.EnvTest(), fun
434433
})
435434
})
436435

437-
When("reconciling an object that is modified concurrently", func() {
438-
It("should successfully add the finalizer despite the conflict", func(ctx context.Context) {
439-
// when
440-
component, createErr := createComponentRequiringPlatformRouting(ctx, "conflict-test-component", "external", appNs.Name)
441-
Expect(createErr).ToNot(HaveOccurred())
442-
toRemove = append(toRemove, component)
443-
444-
// Ensure the component doesn't have finalizers initially
445-
Expect(component.GetFinalizers()).To(BeEmpty())
446-
447-
modifyComponent := func(ctx context.Context) {
448-
updatedComponent := &unstructured.Unstructured{}
449-
updatedComponent.SetGroupVersionKind(component.GroupVersionKind())
450-
Expect(envTest.Client.Get(ctx, types.NamespacedName{Name: component.GetName(), Namespace: component.GetNamespace()}, updatedComponent)).To(Succeed())
451-
452-
annotations := updatedComponent.GetAnnotations()
453-
if annotations == nil {
454-
annotations = make(map[string]string)
455-
}
456-
annotations["test-annotation"] = "modified"
457-
updatedComponent.SetAnnotations(annotations)
458-
459-
Expect(envTest.Client.Update(ctx, updatedComponent)).To(Succeed())
460-
}
461-
462-
// Simulate concurrent modifications by adding an annotation to the resource
463-
go func(ctx context.Context) {
464-
defer GinkgoRecover()
465-
466-
modifyComponent(ctx)
467-
468-
}(ctx)
469-
470-
// Wait for the reconciliation to add finalizer successfully
471-
Eventually(func(ctx context.Context) error {
472-
updatedComponent := &unstructured.Unstructured{}
473-
updatedComponent.SetGroupVersionKind(component.GroupVersionKind())
474-
err := envTest.Client.Get(ctx, types.NamespacedName{Name: component.GetName(), Namespace: component.GetNamespace()}, updatedComponent)
475-
if err != nil {
476-
return fmt.Errorf("error getting component: %w", err)
477-
}
478-
479-
if len(updatedComponent.GetFinalizers()) == 0 {
480-
return errors.New("finalizers are empty")
481-
}
482-
483-
testAnnotation, exists := updatedComponent.GetAnnotations()["test-annotation"]
484-
if !exists || testAnnotation != "modified" {
485-
return errors.New("test-annotation is not set to 'modified'")
486-
}
487-
488-
return nil
489-
}).WithContext(ctx).WithTimeout(test.DefaultTimeout * 2).WithPolling(test.DefaultPolling).Should(Succeed())
490-
})
491-
})
492-
493436
})
494437

495438
type exportMode string

0 commit comments

Comments
 (0)