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 60bb1f0831744087519d847350b51aa842b60454..4a4e1f95595626561a24a307876d03c525a40d3e 100644 --- a/eth/handler_test.go +++ b/eth/handler_test.go @@ -670,7 +670,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 958eb2912986845d3605b7f1367f85e291d52113..7dc344a67df5ddcc3942582afe00b6236df0fe1f 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 9c7f72053b41f3bfe4bfea21bf666f95ee74093a..0287dad088383cfd5dfa1a1a288f72ce4942d710 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 )