From ac41a75499abf1ef0283e3f6d140dedc269fb832 Mon Sep 17 00:00:00 2001 From: Ferenc Szabo Date: Thu, 7 Feb 2019 13:37:25 +0100 Subject: [PATCH] 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. --- swarm/network/networkid_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/swarm/network/networkid_test.go b/swarm/network/networkid_test.go index 8e68e5b521..9d47cf9f6a 100644 --- a/swarm/network/networkid_test.go +++ b/swarm/network/networkid_test.go @@ -44,7 +44,7 @@ var ( const ( NumberOfNets = 4 - MaxTimeout = 6 + MaxTimeout = 15 * time.Second ) 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) } //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() watchSubscriptionEvents(ctx, nodes[i].ID(), client, errc, quitC) //on every iteration we connect to all previous ones