e2e: extend timeouts in test harness (#6694)

This commit is contained in:
Sam Kleinman
2021-07-13 11:28:07 -04:00
committed by GitHub
parent a12e2bbb60
commit 8228936155
8 changed files with 11 additions and 11 deletions

View File

@@ -80,7 +80,7 @@ func newSnapshotPool(stateProvider StateProvider) *snapshotPool {
// snapshot height is verified using the light client, and the expected app hash
// is set for the snapshot.
func (p *snapshotPool) Add(peerID types.NodeID, snapshot *snapshot) (bool, error) {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
ctx, cancel := context.WithTimeout(context.TODO(), 30*time.Second)
defer cancel()
appHash, err := p.stateProvider.AppHash(ctx, snapshot.Height)

View File

@@ -94,7 +94,7 @@ func NewLightClientStateProviderFromDispatcher(
trustOptions light.TrustOptions,
logger log.Logger,
) (StateProvider, error) {
providers := dispatcher.Providers(chainID, 10*time.Second)
providers := dispatcher.Providers(chainID, 30*time.Second)
if len(providers) < 2 {
return nil, fmt.Errorf("at least 2 peers are required, got %d", len(providers))
}

View File

@@ -277,7 +277,7 @@ func (s *syncer) Sync(ctx context.Context, snapshot *snapshot, chunks *chunkQueu
go s.fetchChunks(fetchCtx, snapshot, chunks)
}
pctx, pcancel := context.WithTimeout(ctx, 10*time.Second)
pctx, pcancel := context.WithTimeout(ctx, 30*time.Second)
defer pcancel()
// Optimistically build new state, so we don't discover any light client failures at the end.

View File

@@ -65,7 +65,7 @@ func InjectEvidence(testnet *e2e.Testnet, amount int) error {
// wait for the node to reach the height above the forged height so that
// it is able to validate the evidence
status, err := waitForNode(targetNode, waitHeight, 15*time.Second)
status, err := waitForNode(targetNode, waitHeight, 30*time.Second)
if err != nil {
return err
}

View File

@@ -16,7 +16,7 @@ func Perturb(testnet *e2e.Testnet) error {
if err != nil {
return err
}
time.Sleep(3 * time.Second) // give network some time to recover between each
time.Sleep(5 * time.Second) // give network some time to recover between each
}
}
return nil
@@ -72,7 +72,7 @@ func PerturbNode(node *e2e.Node, perturbation e2e.Perturbation) (*rpctypes.Resul
return nil, nil
}
status, err := waitForNode(node, 0, 15*time.Second)
status, err := waitForNode(node, 0, 2*time.Minute)
if err != nil {
return nil, err
}

View File

@@ -37,7 +37,7 @@ func waitForHeight(testnet *e2e.Testnet, height int64) (*types.Block, *types.Blo
clients[node.Name] = client
}
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
defer cancel()
result, err := client.Block(ctx, nil)
if err != nil {
@@ -55,7 +55,7 @@ func waitForHeight(testnet *e2e.Testnet, height int64) (*types.Block, *types.Blo
if len(clients) == 0 {
return nil, nil, errors.New("unable to connect to any network nodes")
}
if time.Since(lastIncrease) >= 20*time.Second {
if time.Since(lastIncrease) >= time.Minute {
if maxResult == nil {
return nil, nil, errors.New("chain stalled at unknown height")
}

View File

@@ -43,7 +43,7 @@ func Start(testnet *e2e.Testnet) error {
if err := execCompose(testnet.Dir, "up", "-d", node.Name); err != nil {
return err
}
if _, err := waitForNode(node, 0, 15*time.Second); err != nil {
if _, err := waitForNode(node, 0, time.Minute); err != nil {
return err
}
logger.Info(fmt.Sprintf("Node %v up on http://127.0.0.1:%v", node.Name, node.ProxyPort))
@@ -75,7 +75,7 @@ func Start(testnet *e2e.Testnet) error {
if err := execCompose(testnet.Dir, "up", "-d", node.Name); err != nil {
return err
}
status, err := waitForNode(node, node.StartAt, 1*time.Minute)
status, err := waitForNode(node, node.StartAt, 5*time.Minute)
if err != nil {
return err
}

View File

@@ -30,5 +30,5 @@ func WaitUntil(testnet *e2e.Testnet, height int64) error {
// 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*4)) * time.Second
return time.Minute + (time.Duration(nodes) * (15 * time.Second))
}