mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
swarm/storage/localstore: stop sending to errChan on context done in tests
This commit is contained in:
parent
68f1e07f7e
commit
0b80043abb
2 changed files with 15 additions and 3 deletions
|
|
@ -453,7 +453,11 @@ func readPullSubscriptionBin(ctx context.Context, bin uint8, ch <-chan ChunkDesc
|
||||||
}
|
}
|
||||||
i++
|
i++
|
||||||
// send one and only one error per received address
|
// send one and only one error per received address
|
||||||
errChan <- err
|
select {
|
||||||
|
case errChan <- err:
|
||||||
|
case <-ctx.Done():
|
||||||
|
return
|
||||||
|
}
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,11 @@ func TestDB_SubscribePush(t *testing.T) {
|
||||||
}
|
}
|
||||||
i++
|
i++
|
||||||
// send one and only one error per received address
|
// send one and only one error per received address
|
||||||
errChan <- err
|
select {
|
||||||
|
case errChan <- err:
|
||||||
|
case <-ctx.Done():
|
||||||
|
return
|
||||||
|
}
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -175,7 +179,11 @@ func TestDB_SubscribePush_multiple(t *testing.T) {
|
||||||
}
|
}
|
||||||
i++
|
i++
|
||||||
// send one and only one error per received address
|
// send one and only one error per received address
|
||||||
errChan <- err
|
select {
|
||||||
|
case errChan <- err:
|
||||||
|
case <-ctx.Done():
|
||||||
|
return
|
||||||
|
}
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue