Skip to content

Commit

Permalink
fix: unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
istae committed Feb 27, 2024
1 parent e5e2099 commit 97b404e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
7 changes: 0 additions & 7 deletions pkg/file/joiner/joiner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (
"github.com/ethersphere/bee/pkg/swarm"
"github.com/ethersphere/bee/pkg/util/testutil"
"github.com/ethersphere/bee/pkg/util/testutil/pseudorand"
"github.com/ethersphere/bee/pkg/util/testutil/racedetection"
"gitlab.com/nolash/go-mockbytes"
"golang.org/x/sync/errgroup"
)
Expand Down Expand Up @@ -1253,10 +1252,6 @@ func TestJoinerRedundancyMultilevel(t *testing.T) {
canReadRange := func(t *testing.T, s getter.Strategy, fallback bool, levels int, canRead bool) {
ctx := context.Background()
strategyTimeout := 100 * time.Millisecond
decodingTimeout := 600 * time.Millisecond
if racedetection.IsOn() {
decodingTimeout *= 2
}

strategyTimeoutStr := strategyTimeout.String()
decodingTimeoutStr := (2 * strategyTimeout).String()
Expand All @@ -1266,8 +1261,6 @@ func TestJoinerRedundancyMultilevel(t *testing.T) {
t.Fatal(err)
}

ctx, cancel := context.WithTimeout(ctx, time.Duration(levels)*(3*strategyTimeout+decodingTimeout))
defer cancel()
j, _, err := joiner.New(ctx, store, store, addr)
if err != nil {
t.Fatal(err)
Expand Down
4 changes: 2 additions & 2 deletions pkg/file/redundancy/getter/getter.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,17 @@ func (g *decoder) fetch(ctx context.Context, i int, waitForRecovery bool) (err e
g.wg.Add(1)
defer g.wg.Done()

defer close(g.waits[i])

// retrieval
ch, err := g.fetcher.Get(fctx, g.addrs[i])
if err != nil {
g.failedCnt.Add(1)
close(g.waits[i])
return waitRecovery(err)
}

g.fetchedCnt.Add(1)
g.setData(i, ch.Data())
close(g.waits[i])
return nil
}

Expand Down

0 comments on commit 97b404e

Please sign in to comment.