Description
The codebase has goroutine lifecycle improvements underway (e.g., docker_images.go, update_check.go), but there is currently zero usage of goleak in any test package. Without goleak, goroutine leaks can be introduced silently in future changes.
Suggested Changes
- Add
github.com/uber-go/goleak as a test dependency
- Add
goleak.VerifyTestMain(m) to TestMain in packages that launch goroutines:
pkg/cli/ (contains update_check.go, docker_images.go, bootstrap_profile_*.go)
pkg/console/ (spinner goroutine)
- Add
defer goleak.VerifyNone(t) to individual tests that exercise goroutine-launching paths
- Ensure all goroutine lifecycle fixes already merged pass under goleak
Files Affected
pkg/cli/update_check_test.go (add or update TestMain)
pkg/cli/docker_images_test.go (add or update TestMain)
pkg/console/spinner_test.go (add leak assertion)
go.mod / go.sum (new test dependency)
Success Criteria
goleak is imported in ≥3 test packages covering goroutine-launching code
- All existing tests pass with leak detection enabled
- CI fails if a future change introduces a goroutine leak
Source
Extracted from DeepReport Intelligence Briefing - 2026-07-24 discussion #47817
Priority
Medium — prevents regression of in-flight goroutine lifecycle fixes
🔍 Task mining by Discussion Task Miner - Code Quality Improvement Agent · sonnet46 · 54.2 AIC · ⌖ 8.34 AIC · ⊞ 7.2K · ◷
Description
The codebase has goroutine lifecycle improvements underway (e.g.,
docker_images.go,update_check.go), but there is currently zero usage ofgoleakin any test package. Withoutgoleak, goroutine leaks can be introduced silently in future changes.Suggested Changes
github.com/uber-go/goleakas a test dependencygoleak.VerifyTestMain(m)toTestMainin packages that launch goroutines:pkg/cli/(containsupdate_check.go,docker_images.go,bootstrap_profile_*.go)pkg/console/(spinner goroutine)defer goleak.VerifyNone(t)to individual tests that exercise goroutine-launching pathsFiles Affected
pkg/cli/update_check_test.go(add or updateTestMain)pkg/cli/docker_images_test.go(add or updateTestMain)pkg/console/spinner_test.go(add leak assertion)go.mod/go.sum(new test dependency)Success Criteria
goleakis imported in ≥3 test packages covering goroutine-launching codeSource
Extracted from DeepReport Intelligence Briefing - 2026-07-24 discussion #47817
Priority
Medium — prevents regression of in-flight goroutine lifecycle fixes