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