From 63d34ba7d10bf337ad1e36761fde221be49b8d6b Mon Sep 17 00:00:00 2001 From: Ferenc Szabo Date: Wed, 20 Feb 2019 14:08:49 +0100 Subject: [PATCH] swarm/network: run TestRetrieval with fewer nodes with -race Otherwise we get a failure due to extensive memory usage, as the CGO runtime cannot allocate more bytes ("ThreadSanitizer failed to allocate"). --- swarm/network/stream/snapshot_retrieval_test.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/swarm/network/stream/snapshot_retrieval_test.go b/swarm/network/stream/snapshot_retrieval_test.go index 5bdd851068..5e24a39f57 100644 --- a/swarm/network/stream/snapshot_retrieval_test.go +++ b/swarm/network/stream/snapshot_retrieval_test.go @@ -82,18 +82,17 @@ func TestRetrieval(t *testing.T) { t.Fatal(err) } } else { - var nodeCnt []int - var chnkCnt []int - //if the `longrunning` flag has been provided - //run more test combinations + nodeCnt := []int{16} + chnkCnt := []int{32} + if *longrunning { nodeCnt = []int{16, 32, 128} chnkCnt = []int{4, 32, 256} - } else { - //default test - nodeCnt = []int{16} - chnkCnt = []int{32} + } else if testutil.RaceEnabled { + nodeCnt = []int{4} + chnkCnt = []int{4} } + for _, n := range nodeCnt { for _, c := range chnkCnt { t.Run(fmt.Sprintf("TestRetrieval_%d_%d", n, c), func(t *testing.T) {