test(scanner): run the goroutine leak check unconditionally

The scanner suite's goleak check only ran when the GOLEAK env var was set, so it
never ran in CI and could not catch a regression. It passes with the existing
ignore list, verified over repeated runs, so the gate is removed.
This commit is contained in:
Deluan 2026-08-19 23:47:34 -04:00
parent 758857b210
commit 8c44f877b6

View File

@ -3,7 +3,6 @@ package scanner_test
import (
"context"
"io/fs"
"os"
"testing"
"github.com/navidrome/navidrome/consts"
@ -31,16 +30,13 @@ func init() {
}
func TestScanner(t *testing.T) {
// Only run goleak checks when the GOLEAK env var is set
if os.Getenv("GOLEAK") != "" {
// 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"),
)
}
// 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)
defer db.Close(context.Background())