test(controller): add goleak test cases to detect goroutine leaks #1810
Open
dongjiang1989 wants to merge 1 commit intokagent-dev:mainfrom
Open
test(controller): add goleak test cases to detect goroutine leaks #1810dongjiang1989 wants to merge 1 commit intokagent-dev:mainfrom
dongjiang1989 wants to merge 1 commit intokagent-dev:mainfrom
Conversation
Signed-off-by: dongjiang <dongjiang1989@126.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds go.uber.org/goleak to the Go module and wires it into controller-related test suites via TestMain, aiming to detect goroutine leaks during tests (notably around reconciler behavior).
Changes:
- Add
go.uber.org/goleakdependency. - Enable goleak verification for
controllerpackage tests via a newTestMain. - Enable goleak verification for
reconcilerpackage tests viaTestMainin the MCP server reconciler test file.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| go/go.mod | Adds the go.uber.org/goleak dependency. |
| go/core/internal/controller/goleak_test.go | Adds package-level TestMain to run goleak verification for controller tests. |
| go/core/internal/controller/reconciler/mcp_server_reconciler_test.go | Adds goleak TestMain for reconciler package tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
cc @EItanya PTAL |
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.
Summary
goleakverification to the controller package test suite viaTestMain, ensuring goroutine leaks are detected across all controller testsTest plan
go test ./go/core/internal/controller/...— goleak runs automatically on every testgo test ./go/core/internal/controller/reconciler/...— reconciler goleak tests pass