Skip to content
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

proposal: add a goroutine leak detector to go test #25523

Closed
jeanbza opened this issue May 23, 2018 · 2 comments
Closed

proposal: add a goroutine leak detector to go test #25523

jeanbza opened this issue May 23, 2018 · 2 comments

Comments

@jeanbza
Copy link
Member

jeanbza commented May 23, 2018

Inspired by grpc-go's leak detector (example usage here) by @menghanl and co.

Leaking goroutines is a problem that's hard to spot. We can help users detect these goroutines by adding a -leak flag to go test that detects leaking goroutines. A rough outline of the lifecycle of a test in the presence of this flag is as follows:

  1. Count non-test, non-runtime goroutines
  2. Run the test
  3. Wait some period of time for things to shut down (possibly configurable with a default of 100ms, for instance)
  4. Count non-test, non-runtime goroutines
  5. If before != after, err
@gopherbot gopherbot added this to the Proposal milestone May 23, 2018
@jeanbza
Copy link
Member Author

jeanbza commented May 23, 2018

Dupe #5308 / #6705

@jeanbza jeanbza closed this as completed May 23, 2018
@jeanbza
Copy link
Member Author

jeanbza commented May 23, 2018

@golang golang locked and limited conversation to collaborators May 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants