mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
swarm/network: increase timeout for TestNetworkID
The following test failed with `-race` flag on Travis.
--- FAIL: TestNetworkID (9.04s)
networkid_test.go:77: Error setting up network: context deadline exceeded
As `-race` can increase the run time by 10x.
This commit is contained in:
parent
2102dec3f3
commit
ac41a75499
1 changed files with 2 additions and 2 deletions
|
|
@ -44,7 +44,7 @@ var (
|
||||||
|
|
||||||
const (
|
const (
|
||||||
NumberOfNets = 4
|
NumberOfNets = 4
|
||||||
MaxTimeout = 6
|
MaxTimeout = 15 * time.Second
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
@ -146,7 +146,7 @@ func setupNetwork(numnodes int) (net *simulations.Network, err error) {
|
||||||
return nil, fmt.Errorf("create node %d rpc client fail: %v", i, err)
|
return nil, fmt.Errorf("create node %d rpc client fail: %v", i, err)
|
||||||
}
|
}
|
||||||
//now setup and start event watching in order to know when we can upload
|
//now setup and start event watching in order to know when we can upload
|
||||||
ctx, watchCancel := context.WithTimeout(context.Background(), MaxTimeout*time.Second)
|
ctx, watchCancel := context.WithTimeout(context.Background(), MaxTimeout)
|
||||||
defer watchCancel()
|
defer watchCancel()
|
||||||
watchSubscriptionEvents(ctx, nodes[i].ID(), client, errc, quitC)
|
watchSubscriptionEvents(ctx, nodes[i].ID(), client, errc, quitC)
|
||||||
//on every iteration we connect to all previous ones
|
//on every iteration we connect to all previous ones
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue