From 31548dc28f660dbe19ecebe1bbd7f7902a8a3b07 Mon Sep 17 00:00:00 2001 From: Ekaterina Pavlova Date: Tue, 19 Mar 2024 19:21:28 +0300 Subject: [PATCH] network: fix logging data race in the package Nested goroutines could cause logging race. Close #3316 Signed-off-by: Ekaterina Pavlova --- pkg/network/server_test.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) 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