p2p: fix goroutine leaks in unit tests #20666 (#954)

This commit is contained in:
Daniel Liu 2025-04-22 15:14:21 +08:00 committed by GitHub
parent 4f98a8b81c
commit 1667b1027d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -128,7 +128,7 @@ func TestServerDial(t *testing.T) {
t.Fatalf("could not setup listener: %v", err)
}
defer listener.Close()
accepted := make(chan net.Conn)
accepted := make(chan net.Conn, 1)
go func() {
conn, err := listener.Accept()
if err != nil {