mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
swarm/network: run TestFileRetrieval with fewer nodes with -race
Otherwise we get a failure due to extensive memory usage, as the CGO runtime cannot allocate more bytes. === RUN TestFileRetrieval ==7366==ERROR: ThreadSanitizer failed to allocate 0x80000 (524288) bytes of clock allocator (error code: 12) FATAL: ThreadSanitizer CHECK failed: ./gotsan.cc:6976 "((0 && "unable to mmap")) != (0)" (0x0, 0x0) FAIL github.com/ethereum/go-ethereum/swarm/network/stream 155.165s
This commit is contained in:
parent
036a351640
commit
5798cdddb5
1 changed files with 16 additions and 13 deletions
|
|
@ -22,6 +22,8 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/swarm/testutil"
|
||||
|
||||
"github.com/ethereum/go-ethereum/node"
|
||||
"github.com/ethereum/go-ethereum/p2p/enode"
|
||||
"github.com/ethereum/go-ethereum/p2p/simulations/adapters"
|
||||
|
|
@ -43,23 +45,24 @@ const (
|
|||
//Files are uploaded to nodes, other nodes try to retrieve the file
|
||||
//Number of nodes can be provided via commandline too.
|
||||
func TestFileRetrieval(t *testing.T) {
|
||||
var nodeCount []int
|
||||
|
||||
if *nodes != 0 {
|
||||
err := runFileRetrievalTest(*nodes)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
nodeCount = []int{*nodes}
|
||||
} else {
|
||||
nodeCnt := []int{16}
|
||||
//if the `longrunning` flag has been provided
|
||||
//run more test combinations
|
||||
nodeCount = []int{16}
|
||||
|
||||
if *longrunning {
|
||||
nodeCnt = append(nodeCnt, 32, 64, 128)
|
||||
nodeCount = append(nodeCount, 32, 64, 128)
|
||||
} else if testutil.RaceEnabled {
|
||||
nodeCount = []int{4}
|
||||
}
|
||||
for _, n := range nodeCnt {
|
||||
err := runFileRetrievalTest(n)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for _, nc := range nodeCount {
|
||||
if err := runFileRetrievalTest(nc); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue