event, p2p/simulations/adapters: fix rare goroutine leaks (#20657)

Co-authored-by: Felix Lange <fjl@twurst.com>
This commit is contained in:
Boqin Qin
2020-02-12 22:19:47 +08:00
committed by GitHub
parent 46c4b699c8
commit a9614c3c91
3 changed files with 10 additions and 11 deletions

View File

@ -102,7 +102,7 @@ func TestResubscribe(t *testing.T) {
func TestResubscribeAbort(t *testing.T) {
t.Parallel()
done := make(chan error)
done := make(chan error, 1)
sub := Resubscribe(0, func(ctx context.Context) (Subscription, error) {
select {
case <-ctx.Done():