Skip to content

Commit

Permalink
e2e: relax timeouts (#6356)
Browse files Browse the repository at this point in the history
* remove duplicate light error

* quieten handling of txs that already exist in the mempool

* notch back e2e timeouts
  • Loading branch information
cmwaters authored Apr 14, 2021
1 parent 693e11c commit b878326
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 15 deletions.
4 changes: 2 additions & 2 deletions light/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func NewClientFromTrustedStore(

// Validate the number of witnesses.
if len(c.witnesses) < 1 {
return nil, errNoWitnesses{}
return nil, ErrNoWitnesses
}

// Verify witnesses are all on the same chain.
Expand Down Expand Up @@ -1127,7 +1127,7 @@ func (c *Client) compareFirstHeaderWithWitnesses(ctx context.Context, h *types.S
defer c.providerMutex.Unlock()

if len(c.witnesses) < 1 {
return errNoWitnesses{}
return ErrNoWitnesses
}

errc := make(chan error, len(c.witnesses))
Expand Down
2 changes: 1 addition & 1 deletion light/detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (c *Client) detectDivergence(ctx context.Context, primaryTrace []*types.Lig
defer c.providerMutex.Unlock()

if len(c.witnesses) == 0 {
return errNoWitnesses{}
return ErrNoWitnesses
}

// launch one goroutine per witness to retrieve the light block of the target height
Expand Down
8 changes: 0 additions & 8 deletions light/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,6 @@ func (e errConflictingHeaders) Error() string {
e.Block.Hash(), e.WitnessIndex)
}

// errNoWitnesses means that there are not enough witnesses connected to
// continue running the light client.
type errNoWitnesses struct{}

func (e errNoWitnesses) Error() string {
return "no witnesses connected. please reset light client"
}

// errBadWitness is returned when the witness either does not respond or
// responds with an invalid header.
type errBadWitness struct {
Expand Down
4 changes: 3 additions & 1 deletion mempool/reactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ func (memR *Reactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) {
}
for _, tx := range msg.Txs {
err = memR.mempool.CheckTx(tx, nil, txInfo)
if err != nil {
if err == ErrTxInCache {
memR.Logger.Debug("Tx already exists in cache", "tx", txID(tx))
} else if err != nil {
memR.Logger.Info("Could not check tx", "tx", txID(tx), "err", err)
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/runner/perturb.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func PerturbNode(node *e2e.Node, perturbation e2e.Perturbation) (*rpctypes.Resul
return nil, fmt.Errorf("unexpected perturbation %q", perturbation)
}

status, err := waitForNode(node, 0, 10*time.Second)
status, err := waitForNode(node, 0, 20*time.Second)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/runner/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, 3*time.Minute)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/tests/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func TestApp_Tx(t *testing.T) {
require.NoError(t, err)

hash := tx.Hash()
waitTime := 20 * time.Second
waitTime := 30 * time.Second
require.Eventuallyf(t, func() bool {
txResp, err := client.Tx(ctx, hash, false)
return err == nil && bytes.Equal(txResp.Tx, tx)
Expand Down

0 comments on commit b878326

Please sign in to comment.