server&tests: Fix goroutine leaks

This commit is contained in:
lzhfromustc
2021-03-23 12:52:59 -04:00
parent 4f34f14830
commit 3de6b382df
2 changed files with 2 additions and 2 deletions

View File

@@ -260,7 +260,7 @@ func restoreCluster(t *testing.T, clusterN int, dbPath string) (
cfgs[i] = cfg
}
sch := make(chan *embed.Etcd)
sch := make(chan *embed.Etcd, len(cfgs))
for i := range cfgs {
go func(idx int) {
srv, err := embed.StartEtcd(cfgs[idx])