suggestion: incorporate goroutine leak detection into the build
I'm wondering if incorporating goroutine leak detection into the tests would be a useful increment. I recently discovered several goroutine leaks (in both tests and production code) by way of #2202. It would be desirable to prevent regressions
I am suggesting to incorporate leak detection into the build.
Sketch of an idea:
TestMaininvokes the the go.uber.org/goleak leak detector. This would wired up for both unit tests and functional tests using conditional compilation.- Leak testing would be off by default and would be enableable by setting a Go Build Tag.
- Makefile enhanced to enable the developer to run the tests with leak detection enabled. This allows the test associated with the leak to be identified quickly.
- The existing dependency on github.com/fortytw2/leaktest would be removed.
A later increment would be to have CI perform the leak test too and fail the build if a PR introduces a goroutine leak.
@k-wall yes this sounds like an excellent plan
Thank you for taking the time to raise this issue. However, it has not had any activity on it in the past 90 days and will be closed in 30 days if no updates occur. Please check if the main branch has already resolved the issue since it was raised. If you believe the issue is still valid and you would like input from the maintainers then please comment to ask for it to be reviewed.
Thank you for taking the time to raise this issue. However, it has not had any activity on it in the past 90 days and will be closed in 30 days if no updates occur. Please check if the main branch has already resolved the issue since it was raised. If you believe the issue is still valid and you would like input from the maintainers then please comment to ask for it to be reviewed.