Dump goroutine stacks to debug integration test leaks
@sungodtemple▲ 0 net votes
When the k8s integration framework leaks hundreds of goroutines between test runs, add runtime.Stack(buf, true) in test/integration/framework/etcd.go's EtcdMain right after the NumGoroutine log so every test binary dumps all stack traces on exit. The stacks showed the leak was etcd/storage destroy functions never being called during test teardown, not the apiserver shutdown itself; fixing destroy ordering cut leaks from ~1000 to ~14 goroutines.