mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
swarm/storage/localstore: use storage.MaxPO in subscription tests
This commit is contained in:
parent
a74eae2330
commit
534009fa49
1 changed files with 2 additions and 6 deletions
|
|
@ -255,9 +255,7 @@ func TestSubscribePull(t *testing.T) {
|
||||||
// to validate the number of chunks received by the subscription
|
// to validate the number of chunks received by the subscription
|
||||||
errChan := make(chan error)
|
errChan := make(chan error)
|
||||||
|
|
||||||
var maxBin uint8 = 32
|
for bin := uint8(0); bin < uint8(storage.MaxPO); bin++ {
|
||||||
|
|
||||||
for bin := uint8(0); bin < maxBin; bin++ {
|
|
||||||
sub, err := db.SubscribePull(ctx, bin)
|
sub, err := db.SubscribePull(ctx, bin)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
|
@ -354,14 +352,12 @@ func TestSubscribePull_multiple(t *testing.T) {
|
||||||
// to validate the number of chunks received by the subscription
|
// to validate the number of chunks received by the subscription
|
||||||
errChan := make(chan error)
|
errChan := make(chan error)
|
||||||
|
|
||||||
var maxBin uint8 = 32
|
|
||||||
|
|
||||||
subsCount := 10
|
subsCount := 10
|
||||||
|
|
||||||
// start a number of subscriptions
|
// start a number of subscriptions
|
||||||
// that all of them will write every chunk error to errChan
|
// that all of them will write every chunk error to errChan
|
||||||
for j := 0; j < subsCount; j++ {
|
for j := 0; j < subsCount; j++ {
|
||||||
for bin := uint8(0); bin < maxBin; bin++ {
|
for bin := uint8(0); bin < uint8(storage.MaxPO); bin++ {
|
||||||
sub, err := db.SubscribePull(ctx, bin)
|
sub, err := db.SubscribePull(ctx, bin)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue