test(daemon): enable goleak-based goroutine leak detection harness#127
Open
kangeunchan wants to merge 2 commits intoaltuslabsxyz:mainfrom
Open
test(daemon): enable goleak-based goroutine leak detection harness#127kangeunchan wants to merge 2 commits intoaltuslabsxyz:mainfrom
kangeunchan wants to merge 2 commits intoaltuslabsxyz:mainfrom
Conversation
Signed-off-by: kangeunchan <kangeunchan080310@gmail.com>
Signed-off-by: kangeunchan <kangeunchan080310@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enhancement Description
Enable goleak-based goroutine leak detection in daemon test harnesses to prevent cleanup regressions.
Summary
This PR adds
goleak.VerifyTestMainto key daemon packages and applies a minimal allowlist for known safe exceptions.Previously, goroutine leaks could pass silently in concurrency-heavy packages:
Now leak checks run automatically in targeted test packages.
What Changed
1) Added goleak TestMain harnesses
Added:
internal/daemon/controller/main_test.gointernal/daemon/server/main_test.gointernal/daemon/runtime/main_test.go2) Added scoped allowlist for known server test path
3) Added dependency and required test formatting updates
Updated:
go.mod/go.suminternal/daemon/runtime/service_launchd_test.go4) Tests
Leak-aware test runs were added for targeted daemon packages.
Why This Is Needed
This is a test reliability improvement for concurrency-heavy code.
Automatic leak detection catches lifecycle regressions before merge.
Behavior Notes / Regression Impact
No runtime feature behavior change.
Only test harness strictness is increased.
Validation Performed
go test ./internal/daemon/controller -count=1go test ./internal/daemon/server -count=1go test ./internal/daemon/runtime -count=1go test ./...golangci-lint run