Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(e2e): ignore context cancelled #2531

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmd/zetae2e/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package local

import (
"context"
"errors"
"os"
"path/filepath"
"time"
Expand Down Expand Up @@ -331,7 +332,7 @@ func localE2ETest(cmd *cobra.Command, _ []string) {
// if all tests pass, cancel txs priority monitoring and check if tx priority is not correct in some blocks
logger.Print("⏳ e2e tests passed,checking tx priority")
monitorPriorityCancel()
if err := <-txPriorityErrCh; err != nil {
if err := <-txPriorityErrCh; err != nil && errors.Is(err, errWrongTxPriority) {
logger.Print("❌ %v", err)
logger.Print("❌ e2e tests failed after %s", time.Since(testStartTime).String())
os.Exit(1)
Expand Down
4 changes: 3 additions & 1 deletion cmd/zetae2e/local/monitor_priority_txs.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
"github.com/zeta-chain/zetacore/e2e/config"
)

var errWrongTxPriority = errors.New("wrong tx priority, system tx not on top")

// monitorTxPriorityInBlocks checks for transaction priorities in blocks and reports errors
func monitorTxPriorityInBlocks(ctx context.Context, conf config.Config, errCh chan error) {
rpcClient, err := rpchttp.New(conf.RPCs.ZetaCoreRPC, "/websocket")
Expand Down Expand Up @@ -71,7 +73,7 @@ func processTx(txResult *coretypes.ResultTx, nonSystemTxFound *bool, errCh chan
if isMsgTypeURLSystemTx(attr) {
// a non system tx has been found in the block before a system tx
if *nonSystemTxFound {
errCh <- errors.New("wrong tx priority, system tx not on top")
errCh <- errWrongTxPriority
return
}
} else {
Expand Down
Loading