test: fix goleak check in combination with script tests#44228
Merged
giorio94 merged 1 commit intocilium:mainfrom Feb 16, 2026
Merged
test: fix goleak check in combination with script tests#44228giorio94 merged 1 commit intocilium:mainfrom
giorio94 merged 1 commit intocilium:mainfrom
Conversation
Member
Author
|
/ci-integration |
Member
Author
|
/test |
Member
Author
|
Conformance Runtime seems to have failed due to a legitimate goleak in the linux package (that obviously I didn't manage to trigger when testing locally). Will double-check later. |
cbf99fc to
cf67130
Compare
Member
Author
Build tags hit again, should be fixed now. |
Member
Author
|
/test |
MrFreezeex
approved these changes
Feb 9, 2026
Member
MrFreezeex
left a comment
There was a problem hiding this comment.
Thanks for this great finding and for all the details helping understanding the fix! :D
dylandreimerink
approved these changes
Feb 10, 2026
Member
dylandreimerink
left a comment
There was a problem hiding this comment.
LGTM for my codeowners
Member
Author
|
@cilium/envoy @cilium/sig-servicemesh Gentle ping 🙏 |
mhofstetter
approved these changes
Feb 12, 2026
Member
Author
|
I think GitHub is confused here, because of the codeowners changes that got recently merged. Attempting a rebase. |
Currently, multiple script tests are intended to validate that no goroutines are leaked once the tests end, deferring the invocation of the dedicated [testutils.GoleakVerifyNone] function. However, the underlying [goleak.VerifyNone] utility is incompatible with t.Parallel [1], which is set by default by script tests, and no check is actually performed. Let's get this fixed by using [goleak.VerifyTestMain] instead, as also suggested by goleak documentation itself. This commit fixes all occurrences spotted via: $ git grep -l GoleakVerifyNone | xargs grep -l testdata It is worth additionally mentioning that: * GoleakVerifyTestMain was already invoked in the redirectpolicy package, and is thus not added; * The functions previously ignored in the devices_controller tests do not appear to be necessary anymore, and have been omitted; yet, we need to additionally ignore one metrics related goroutine that is otherwise flagged when IPSec is enabled; * One of the script tests in the route/reconciler package did not correctly stop the hive, causing a few goroutines to be leaked. Ideally we should have a linter to catch this problem directly in CI, but that's deferred for the future. [1]: https://pkg.go.dev/go.uber.org/goleak#VerifyNone Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
cf67130 to
50434ce
Compare
Member
Author
|
/test |
YutaroHayakawa
approved these changes
Feb 14, 2026
aanm
approved these changes
Feb 16, 2026
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.
Currently, multiple script tests are intended to validate that no goroutines are leaked once the tests end, deferring the invocation of the dedicated [testutils.GoleakVerifyNone] function. However, the underlying [goleak.VerifyNone] utility is incompatible with t.Parallel [1], which is set by default by script tests, and no check is actually performed.
Let's get this fixed by using [goleak.VerifyTestMain] instead, as also suggested by goleak documentation itself. This commit fixes all occurrences spotted via:
$ git grep -l GoleakVerifyNone | xargs grep -l testdata
It is worth additionally mentioning that:
Ideally we should have a linter to catch this problem directly in CI, but that's deferred for the future.
[1]: https://pkg.go.dev/go.uber.org/goleak#VerifyNone
Tentatively marked for backport to v1.19 as well, given that it is a test only change.