diff --git a/swarm/network/simulations/discovery/discovery_test.go b/swarm/network/simulations/discovery/discovery_test.go index 5227de3bb5..99a0c77224 100644 --- a/swarm/network/simulations/discovery/discovery_test.go +++ b/swarm/network/simulations/discovery/discovery_test.go @@ -27,6 +27,8 @@ import ( "testing" "time" + "github.com/ethereum/go-ethereum/swarm/testutil" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/node" @@ -82,12 +84,19 @@ func getDbStore(nodeID string) (*state.DBStore, error) { } var ( - nodeCount = flag.Int("nodes", 32, "number of nodes to create (default 32)") + nodeCount = flag.Int("nodes", defaultNodeCount(), "number of nodes to create (default 32)") initCount = flag.Int("conns", 1, "number of originally connected peers (default 1)") loglevel = flag.Int("loglevel", 3, "verbosity of logs") rawlog = flag.Bool("rawlog", false, "remove terminal formatting from logs") ) +func defaultNodeCount() int { + if testutil.RaceEnabled { + return 8 + } + return 32 +} + func init() { flag.Parse() // register the discovery service which will run as a devp2p