Open cyga opened 4 months ago
yes - there are goroutines that outlive each individual spec and that outlive the entire test. the fix you propose would fix the leak that outlives the entire test. fwiw - you may want to use gleak
: https://onsi.github.io/gomega/#codegleakcode-finding-leaked-goroutines - it’s tailored to work with Ginkgo and Gomega and would help you confirm that your tests don’t leak at a more granular level (i.e. no individual spec should leak - not just the entire suite). this is useful to debug when leaks occur. it also has the advantage of being aware of ginkgo’s goroutines and ignoring them.
@onsi thanks for a quick response and advice about gleak
. I already saw gleak
mentioned in one of open issues. I am going to try to adopt it as a workaround for automatic goroutine leak testing in my company's monorepo.
However, as far as I understood there is no need for the interrupt handler goroutine to outlive the whole suite. Thus, this is a good idea to change this behaviour. Can you confirm that?
yes that’s also correct - if you want to submit a PR please do
How to reproduce:
It looks like the following diff can fix this problem:
Though, I'm not sure if this is the best way to do it.