diff --git a/pkg/network/server_test.go b/pkg/network/server_test.go index c1b5d96dc..5de7095ce 100644 --- a/pkg/network/server_test.go +++ b/pkg/network/server_test.go @@ -335,16 +335,7 @@ func TestServerNotSendsVerack(t *testing.T) { p2 = newLocalPeer(t, s) ) s.id = 1 - finished := make(chan struct{}) - go func() { - go s.run() - close(finished) - }() - t.Cleanup(func() { - // close via quit as server was started via `run()`, not `Start()` - close(s.quit) - <-finished - }) + startWithCleanup(t, s) na, _ := net.ResolveTCPAddr("tcp", "0.0.0.0:3000") p.netaddr = *na