diff --git a/common/mclock/simclock_test.go b/common/mclock/simclock_test.go index 94aa4f2b39ea9d7530d81e62b4962d0fa1ba9b79..48f3fd56a06acd1ef55a8e8aaafa6b7f2726bfea 100644 --- a/common/mclock/simclock_test.go +++ b/common/mclock/simclock_test.go @@ -96,7 +96,7 @@ func TestSimulatedSleep(t *testing.T) { var ( c Simulated timeout = 1 * time.Hour - done = make(chan AbsTime) + done = make(chan AbsTime, 1) ) go func() { c.Sleep(timeout) diff --git a/eth/handler_test.go b/eth/handler_test.go index 9ae8a190502cfbf178cb55df3bbd0fe841cd54ed..42a8700a4d8c2f7a22f0f4c7c9c4be9098ef15e9 100644 --- a/eth/handler_test.go +++ b/eth/handler_test.go @@ -1320,7 +1320,7 @@ func TestBroadcastMalformedBlock(t *testing.T) { malformedEverything.TxHash[0]++ // Keep listening to broadcasts and notify if any arrives - notify := make(chan struct{}) + notify := make(chan struct{}, 1) go func() { if _, err := sink.app.ReadMsg(); err == nil { notify <- struct{}{} diff --git a/p2p/server_test.go b/p2p/server_test.go index 34371beb14cd014ac3958ec77d0e3d6a1a74e926..ccd6a89ee3e7b1a5ffef4ececfef6c28a9da5e6a 100644 --- a/p2p/server_test.go +++ b/p2p/server_test.go @@ -550,7 +550,7 @@ func TestServerInboundThrottle(t *testing.T) { conn.Close() // Dial again. This time the server should close the connection immediately. - connClosed := make(chan struct{}) + connClosed := make(chan struct{}, 1) conn, err = net.DialTimeout("tcp", srv.ListenAddr, timeout) if err != nil { t.Fatalf("could not dial: %v", err) diff --git a/rpc/client_test.go b/rpc/client_test.go index 97f9a95b23503c65ce600f9cb95504d2f1b2a7b7..a89f2570436b806114a2293932f5566eccc1924b 100644 --- a/rpc/client_test.go +++ b/rpc/client_test.go @@ -297,7 +297,7 @@ func TestClientSubscribeClose(t *testing.T) { var ( nc = make(chan int) - errc = make(chan error) + errc = make(chan error, 1) sub *ClientSubscription err error )