Skip to content

Commit

Permalink
revert moving queue initialisation into testcases
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
  • Loading branch information
inteon committed Apr 26, 2023
1 parent fc5ea5c commit 6d8195f
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions pkg/source/source_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ import (
var _ = Describe("Source", func() {
var instance1, instance2 source.Source
var obj client.Object
var q workqueue.RateLimitingInterface
var c1, c2 chan interface{}
var ns string
count := 0

Expand All @@ -50,6 +52,10 @@ var _ = Describe("Source", func() {
ObjectMeta: metav1.ObjectMeta{Name: ns},
}, metav1.CreateOptions{})
Expect(err).NotTo(HaveOccurred())

q = workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "test")
c1 = make(chan interface{})
c2 = make(chan interface{})
})

JustBeforeEach(func() {
Expand All @@ -60,19 +66,15 @@ var _ = Describe("Source", func() {
AfterEach(func() {
err := clientset.CoreV1().Namespaces().Delete(ctx, ns, metav1.DeleteOptions{})
Expect(err).NotTo(HaveOccurred())
close(c1)
close(c2)
})

Describe("Kind", func() {
Context("for a Deployment resource", func() {
obj = &appsv1.Deployment{}

It("should provide Deployment Events", func() {
q := workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "test")
c1 := make(chan interface{})
c2 := make(chan interface{})
defer close(c1)
defer close(c2)

var created, updated, deleted *appsv1.Deployment
var err error

Expand Down Expand Up @@ -189,12 +191,6 @@ var _ = Describe("Source", func() {
})

It("should not get events after stopped", func() {
q := workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "test")
c1 := make(chan interface{})
c2 := make(chan interface{})
defer close(c1)
defer close(c2)

var created, updated *appsv1.Deployment
var err error

Expand Down

0 comments on commit 6d8195f

Please sign in to comment.