Generated during the wiring of go.uber.org/goleak into TestMain for
internal/campaign, internal/core, and internal/mangle.
| Package | Ignore | Justification |
|---|---|---|
internal/core |
goleak.IgnoreTopFunction("go.opencensus.io/stats/view.(*worker).start") |
OpenCensus stats worker has no clean shutdown hook; process-lifetime by design (pre-existing ignore, preserved). |
internal/core |
goleak.IgnoreTopFunction("database/sql.(*DB).connectionOpener") |
sql.DB connection opener lives until *DB is GC'd; tests don't always Close (pre-existing, preserved). |
internal/core |
goleak.IgnoreAnyFunction("github.com/fsnotify/fsnotify.*") |
fsnotify spawns multiple internal goroutines (readEvents/recv) that vary by OS; pre-existing ignore, preserved. |
internal/mangle |
goleak.IgnoreTopFunction("go.opencensus.io/stats/view.(*worker).start") |
Same as core (pre-existing). |
internal/mangle |
goleak.IgnoreTopFunction("database/sql.(*DB).connectionOpener") |
Same as core (pre-existing). |
internal/campaign |
goleak.IgnoreTopFunction("codenerd/internal/perception.(*ConsolidationWorker).Start.func1") |
internal/perception package init() instantiates SharedTaxonomy, which starts a ConsolidationWorker goroutine with no shutdown hook reachable from test code. Process-lifetime by design. |
internal/campaign |
goleak.IgnoreTopFunction("database/sql.(*DB).connectionOpener") |
Same rationale as core. |
- File:
internal/perception/taxonomy.go:83-89(theinit()block createsSharedTaxonomywhich callsworker.Start()). - Severity: Low. The worker is process-lifetime by design and
Stop()is idempotent, but no code path in tests can call it (the singleton has no exportedShutdownand the worker is unexported). - Recommendation (NOT in scope for Task #9): Add an exported
perception.ShutdownSharedTaxonomy()so test cleanup paths and the chat shutdown hook can stop the worker cleanly. Until then it remains ignored ininternal/campaign/main_test.go.
- Source: Tests in
internal/campaignandinternal/coreopen multiple*sql.DBhandles (likely viainternal/storeandinternal/embeddingpaths) without explicitClose(). Each leaked goroutine corresponds to one un-closed*sql.DB. - Severity: Test-hygiene issue; not a production leak.
database/sqldocuments that callers must Close the DB or accept the connectionOpener goroutine living until GC. - Recommendation (NOT in scope for Task #9): Audit test fixtures in
internal/store,internal/embedding, and the campaign orchestrator test mocks to ensuredefer db.Close()is wired int.Cleanupblocks.
go test ./internal/campaign/... and go test ./internal/core/... currently
fail at the compile stage with:
package codenerd/internal/config
imports codenerd/internal/mcp from integrations.go
imports codenerd/internal/store from store.go
imports codenerd/internal/config from learning.go: import cycle not allowed
The cycle is internal/config -> internal/mcp -> internal/store -> internal/config.
It was introduced by recent commits to internal/store/learning.go (adds
import "codenerd/internal/config") combined with
internal/config/integrations.go (already imports internal/mcp) and
internal/mcp/store.go (already imports internal/store).
The goleak TestMain wiring is correct; this cycle must be resolved by another
task before the goleak verification can run end-to-end on those packages.
internal/mangle is unaffected and its tests pass cleanly with the existing
VerifyTestMain setup.