From 2102dec3f367fc5034b34511e67aada198823733 Mon Sep 17 00:00:00 2001 From: Ferenc Szabo Date: Thu, 7 Feb 2019 13:34:42 +0100 Subject: [PATCH] swarm/storage: increase mput timeout for TestCleanIndex The following test failed with `-race` flag on Travis. --- FAIL: TestCleanIndex (43.85s) ldbstore_test.go:757: context deadline exceeded As `-race` can increase the run time by 10x. Alternative: we could just to increase the timeout for the specific test. As currently the timeout is hardcoded and (strangely) does not depend on the size of 'n'. That could be achieved by adding a new function mputWithCustomTimeout(), but then we should keep symmetry and add custom timeout for mget(), too. But I think the method already has too many parameters and might be replaced by the ongoing storage rewrite. So I won't do. --- swarm/storage/common_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swarm/storage/common_test.go b/swarm/storage/common_test.go index 75d2fed29f..52a28a888e 100644 --- a/swarm/storage/common_test.go +++ b/swarm/storage/common_test.go @@ -91,7 +91,7 @@ func mput(store ChunkStore, n int, f func(i int64) Chunk) (hs []Chunk, err error // put to localstore and wait for stored channel // does not check delivery error state errc := make(chan error) - ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + ctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute) defer cancel() for i := int64(0); i < int64(n); i++ { chunk := f(ch.DefaultSize)