Skip to content

Commit

Permalink
test(file): fix timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
zelig committed Feb 4, 2024
1 parent ec66cc4 commit dcb5ae6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/file/joiner/joiner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,7 @@ func TestJoinerRedundancyMultilevel(t *testing.T) {
strategyTimeout *= 2
}
ctx = getter.SetConfigInContext(ctx, s, fallback, (2 * strategyTimeout).String(), strategyTimeout.String())
ctx, cancel := context.WithTimeout(ctx, time.Duration(levels*3+2)*strategyTimeout)
ctx, cancel := context.WithTimeout(ctx, time.Duration(levels*5)*strategyTimeout)
defer cancel()
j, _, err := joiner.New(ctx, store, store, addr)
if err != nil {
Expand Down
5 changes: 4 additions & 1 deletion pkg/file/redundancy/getter/getter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ func TestGetterFallback(t *testing.T) {
func testDecodingRACE(t *testing.T, bufSize, shardCnt, erasureCnt int) {
t.Helper()
strategyTimeout := 100 * time.Millisecond
if racedetection.On {
strategyTimeout *= 2
}
store := inmem.New()
buf := make([][]byte, bufSize)
addrs := initData(t, buf, shardCnt, store)
Expand Down Expand Up @@ -128,7 +131,7 @@ func testDecodingRACE(t *testing.T, bufSize, shardCnt, erasureCnt int) {
err := context.DeadlineExceeded
wait := strategyTimeout * 2
if racedetection.On {
wait = strategyTimeout * 3
wait *= 2
}
select {
case err = <-q:
Expand Down

0 comments on commit dcb5ae6

Please sign in to comment.