test(scanner): ignore notify's nonrecursive-tree goroutines on Linux

The goroutine leak check only ignored the recursive tree (macOS/FSEvents).
Linux CI uses inotify, whose nonrecursive tree leaks dispatch and internal
goroutines after Stop(), failing the check.
This commit is contained in:
Deluan 2026-08-30 16:41:57 -04:00
parent 7973e78048
commit ef1c49ca09

View File

@ -33,9 +33,11 @@ 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.
// The notify library keeps internal goroutines alive after Stop(). The backend picks the tree per
// platform: recursive on macOS (FSEvents), nonrecursive on Linux (inotify), so ignore both.
goleak.IgnoreTopFunction("github.com/rjeczalik/notify.(*recursiveTree).dispatch"),
goleak.IgnoreTopFunction("github.com/rjeczalik/notify.(*nonrecursiveTree).dispatch"),
goleak.IgnoreTopFunction("github.com/rjeczalik/notify.(*nonrecursiveTree).internal"),
)
tests.Init(t, true)