mirror of
https://github.com/tendermint/tendermint.git
synced 2026-05-22 15:11:29 +00:00
e2e: adjust timeouts to be dynamic to size of network (#6202)
This commit is contained in:
@@ -86,7 +86,7 @@ func waitForNode(node *e2e.Node, height int64, timeout time.Duration) (*rpctypes
|
||||
return status, nil
|
||||
}
|
||||
|
||||
time.Sleep(200 * time.Millisecond)
|
||||
time.Sleep(300 * time.Millisecond)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ func waitForAllNodes(testnet *e2e.Testnet, height int64, timeout time.Duration)
|
||||
if node.Mode == e2e.ModeSeed {
|
||||
continue
|
||||
}
|
||||
status, err := waitForNode(node, height, 20*time.Second)
|
||||
status, err := waitForNode(node, height, timeout)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
@@ -20,9 +20,15 @@ func Wait(testnet *e2e.Testnet, blocks int64) error {
|
||||
// WaitUntil waits until a given height has been reached.
|
||||
func WaitUntil(testnet *e2e.Testnet, height int64) error {
|
||||
logger.Info(fmt.Sprintf("Waiting for all nodes to reach height %v...", height))
|
||||
_, err := waitForAllNodes(testnet, height, 20*time.Second)
|
||||
_, err := waitForAllNodes(testnet, height, waitingTime(len(testnet.Nodes)))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// waitingTime estimates how long it should take for a node to reach the height.
|
||||
// More nodes in a network implies we may expect a slower network and may have to wait longer.
|
||||
func waitingTime(nodes int) time.Duration {
|
||||
return time.Duration(20+(nodes*2)) * time.Second
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user