p2p: add channel buffers to avoid goroutine leaks in tests (#24929)

This commit is contained in:
Boqin@MetaSecureLabs
2022-09-23 10:51:12 +02:00
committed by GitHub
parent 220bdd3277
commit e6d4aedb8c
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -313,7 +313,7 @@ func TestUDPv4_findnodeMultiReply(t *testing.T) {
test.table.db.UpdateLastPingReceived(rid, test.remoteaddr.IP, time.Now())
// queue a pending findnode request
resultc, errc := make(chan []*node), make(chan error)
resultc, errc := make(chan []*node, 1), make(chan error, 1)
go func() {
rid := encodePubkey(&test.remotekey.PublicKey).id()
ns, err := test.udp.findnode(rid, test.remoteaddr, testTarget)