From 51ae79551dfde84be9e939c2bc3675c40ef6afb8 Mon Sep 17 00:00:00 2001 From: Janos Guljas Date: Mon, 3 Dec 2018 14:43:27 +0100 Subject: [PATCH] p2p/simulations: add snapshotLoadTimeout variable --- p2p/simulations/network.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/p2p/simulations/network.go b/p2p/simulations/network.go index ca9deb0c62..1edea152a1 100644 --- a/p2p/simulations/network.go +++ b/p2p/simulations/network.go @@ -707,6 +707,8 @@ func (net *Network) snapshot(addServices []string, removeServices []string) (*Sn return snap, nil } +var snapshotLoadTimeout = 120 * time.Second + // Load loads a network snapshot func (net *Network) Load(snap *Snapshot) error { // Start nodes. @@ -814,7 +816,7 @@ func (net *Network) Load(snap *Snapshot) error { // Wait until all connections from the snapshot are established. case <-allConnected: // Make sure that we do not wait forever. - case <-time.After(120 * time.Second): + case <-time.After(snapshotLoadTimeout): return errors.New("snapshot connections not established") } return nil