use t.Cleanup() for leakage test as well

This commit is contained in:
Alessio Treglia
2020-11-29 09:25:23 +00:00
parent adc05084fd
commit cec4876dfc

View File

@@ -297,7 +297,7 @@ func TestMConnectionMultiplePings(t *testing.T) {
func TestMConnectionPingPongs(t *testing.T) {
// check that we are not leaking any go-routines
defer leaktest.CheckTimeout(t, 10*time.Second)()
t.Cleanup(leaktest.CheckTimeout(t, 10*time.Second))
server, client := net.Pipe()
t.Cleanup(closeAll(t, client, server))