Skip to content

Commit 971295d

Browse files
committed
Add sleep to manager test to avoid event broadcaster leak.
Event broadcaster goroutine leaks may happen due to a race condition where the broadcaster is started and shutdown in quick successtion. Realistically this is not an issue to usage since the broadcaster is usually long lived. To avoid this on the test, a short sleep has been added between start and shutdown. Signed-off-by: Borja Clemente <[email protected]>
1 parent 5ee742d commit 971295d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/manager/manager_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1894,6 +1894,8 @@ var _ = Describe("manger.Manager", func() {
18941894
return nil
18951895
}).ShouldNot(BeNil())
18961896

1897+
time.Sleep(3 * time.Second)
1898+
18971899
By("making sure there's no extra go routines still running after we stop")
18981900
cancel()
18991901
<-doneCh

0 commit comments

Comments
 (0)