diff --git a/scanner/scanner_suite_test.go b/scanner/scanner_suite_test.go index 9b00a428a..6234ecebb 100644 --- a/scanner/scanner_suite_test.go +++ b/scanner/scanner_suite_test.go @@ -2,6 +2,7 @@ package scanner_test import ( "context" + "os" "testing" "github.com/navidrome/navidrome/db" @@ -13,13 +14,16 @@ import ( ) 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"), - ) + // Only run goleak checks when not in CI environment + if os.Getenv("CI") == "" { + // 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())