test(plugins): ignore goroutine leaks from notify library in tests

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan 2025-12-22 14:12:53 -05:00
parent fed00e1838
commit 6ac3ce3511
2 changed files with 8 additions and 4 deletions

View File

@ -88,14 +88,15 @@ var _ = Describe("Watcher Integration", Ordered, func() {
_ = manager.Stop()
conf.Server.Plugins.AutoReload = true
manager = &Manager{
autoReloadManager := &Manager{
plugins: make(map[string]*pluginInstance),
}
err := manager.Start(ctx)
err := autoReloadManager.Start(ctx)
Expect(err).ToNot(HaveOccurred())
DeferCleanup(autoReloadManager.Stop)
Expect(manager.watcherEvents).ToNot(BeNil())
Expect(manager.watcherDone).ToNot(BeNil())
Expect(autoReloadManager.watcherEvents).ToNot(BeNil())
Expect(autoReloadManager.watcherDone).ToNot(BeNil())
})
})
})

View File

@ -16,6 +16,9 @@ func TestScanner(t *testing.T) {
// Detect any goroutine leaks in the scanner code under test
defer goleak.VerifyNone(t,
goleak.IgnoreTopFunction("github.com/onsi/ginkgo/v2/internal/interrupt_handler.(*InterruptHandler).registerForInterrupts.func2"),
// The notify library creates internal goroutines for file watching that persist after Stop() is called.
// These are created by the plugins package tests and are expected behavior.
goleak.IgnoreTopFunction("github.com/rjeczalik/notify.(*recursiveTree).dispatch"),
)
tests.Init(t, true)