-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
default ignorelist entry for rules_go SIGTERM handler #119
default ignorelist entry for rules_go SIGTERM handler #119
Comments
This isn't being considered at the moment. Every stack we ignore by default comes at the cost, and most of users of goleak aren't on rules_go. AFAIK support of this feature isn't something that was discussed with goleak maintainers. |
rules_go added a SIGTERM handler that has a goroutine that survives the scope of the goleak check. Currently, the best known workaround is to ignore this goroutine. uber-go/goleak#119 bazel-contrib/rules_go#3749 bazel-contrib/rules_go#3827 (comment)
rules_go added a SIGTERM handler that has a goroutine that survives the scope of the goleak check. Currently, the best known workaround is to ignore this goroutine. uber-go/goleak#119 bazel-contrib/rules_go#3749 bazel-contrib/rules_go#3827 (comment)
rules_go added a SIGTERM handler that has a goroutine that survives the scope of the goleak check. Currently, the best known workaround is to ignore this goroutine. uber-go/goleak#119 bazel-contrib/rules_go#3749 bazel-contrib/rules_go#3827 (comment)
Sorry for the confusion I caused with the statement quoted above, I think I misunderstood (and thus misrepresented) Lin's plans. The special situation with rules_go is that we (have to) implement a custom test runner, but users have control over when they run goleak's checks and we can't cancel the goroutine in time. I fully understand that goleak doesn't want to maintain a central ignore list. Unfortunately, since the test runner must stay lean and free of external dependencies, we also can't call any of the goleak ignore functions such as @sywhang Do you see a way for goleak to provide "frameworks" such as the rules_go test runner with a way to have certain goroutines ignored by goleak without requiring a dependency on the module? For example, by accepting a list of function names via
|
Hey @fmeum, thanks for providing the context around this. A package-level variable seems like a reasonable solution that's lightweight enough we could consider adding. Seems like this could be useful for non rules_go users as well for cases where there's monorepo-like environments crossing multiple packages. Something like: (naming tbd)
Tagging other maintainers for additional thoughts: @r-hang @abhinav @prashantv Separately, at Uber's Go Monorepo (where we do use rules_go to run tests), we have a file that specifies the list of known leaks - we hijack the rules_go TestMain template generation to inject that list of known leaks at build time and call IgnoreTopFunction on them. |
rules_go added a SIGTERM handler that has a goroutine that survives the scope of the goleak check. Currently, the best known workaround is to ignore this goroutine. uber-go/goleak#119 bazel-contrib/rules_go#3749 bazel-contrib/rules_go#3827 (comment)
@malt3 Could you reopen this issue? |
Sorry! Was an automated close from the PR in another repo |
@sywhang Friendly ping, is this something you would accept contributions for in case all of you are busy? |
This exposes a variable `DefaultIgnoreFunctionSet`, which can be used to set a default list of functions to ignore for goleak. Note that this mechanism is intended for library or tool authors who cannot directly call Ignore* Options to set up how their consumers are running the tests. They should be able to use linkname to set this variable to some well-known list of goroutines that leak if they really want to exempt their goroutines from getting continously flagged by goleak. Fixes uber-go#119.
This exposes a variable `DefaultIgnoreFunctionSet`, which can be used to set a default list of functions to ignore for goleak. Note that this mechanism is intended for library or tool authors who cannot directly call Ignore* Options to set up how their consumers are running the tests. They should be able to use linkname to set this variable to some well-known list of goroutines that leak if they really want to exempt their goroutines from getting continously flagged by goleak. Fixes uber-go#119.
My apologies I completely missed this. |
rules_go added a SIGTERM handler that adds a leaking goroutine to test cases: bazel-contrib/rules_go#3749
-- bazel-contrib/rules_go#3827 (comment)
Can this be added? Adding a manual ignore in every test is not very usable.
The text was updated successfully, but these errors were encountered: