From dcb5ae6324a6efaac1a53e4f22240aa68fcfc5de Mon Sep 17 00:00:00 2001 From: zelig Date: Sat, 3 Feb 2024 22:45:23 +0100 Subject: [PATCH] test(file): fix timeouts --- pkg/file/joiner/joiner_test.go | 2 +- pkg/file/redundancy/getter/getter_test.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/file/joiner/joiner_test.go b/pkg/file/joiner/joiner_test.go index c76406495a5..9a3d1c824d4 100644 --- a/pkg/file/joiner/joiner_test.go +++ b/pkg/file/joiner/joiner_test.go @@ -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 { diff --git a/pkg/file/redundancy/getter/getter_test.go b/pkg/file/redundancy/getter/getter_test.go index d24164ea8ed..b18caa55c12 100644 --- a/pkg/file/redundancy/getter/getter_test.go +++ b/pkg/file/redundancy/getter/getter_test.go @@ -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) @@ -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: