Skip to content

Commit ddd75cd

Browse files
committed
fix(test): add RPCEVMTimeout override to executecodec_test and fix import ordering
Add the same RPCEVMTimeout: 60s override to executecodec_test.go that msghasher_test.go already has. Both tests call eth_call through the simulated backend and are subject to the default 5s timeout under -race -count=100. Also fixes time import ordering per review.
1 parent d492f58 commit ddd75cd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

core/capabilities/ccip/ccipevm/executecodec_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ import (
55
"math/big"
66
"math/rand"
77
"testing"
8+
"time"
89

910
"github.com/ethereum/go-ethereum/accounts/abi"
1011
"github.com/ethereum/go-ethereum/accounts/abi/bind"
1112
"github.com/ethereum/go-ethereum/accounts/abi/bind/backends"
1213
"github.com/ethereum/go-ethereum/common"
1314
"github.com/ethereum/go-ethereum/core/types"
15+
"github.com/ethereum/go-ethereum/eth/ethconfig"
1416
"github.com/ethereum/go-ethereum/ethclient/simulated"
17+
"github.com/ethereum/go-ethereum/node"
1518
chainsel "github.com/smartcontractkit/chain-selectors"
1619
"github.com/stretchr/testify/assert"
1720
"github.com/stretchr/testify/mock"
@@ -176,7 +179,9 @@ func TestExecutePluginCodecV1(t *testing.T) {
176179
transactor := evmtestutils.MustNewSimTransactor(t)
177180
b := simulated.NewBackend(types.GenesisAlloc{
178181
transactor.From: {Balance: assets.Ether(1000).ToInt()},
179-
}, simulated.WithBlockGasLimit(30e6))
182+
}, simulated.WithBlockGasLimit(30e6), func(_ *node.Config, ethCfg *ethconfig.Config) {
183+
ethCfg.RPCEVMTimeout = 60 * time.Second
184+
})
180185
simulatedBackend := &backends.SimulatedBackend{Backend: b, Client: b.Client()}
181186
address, _, _, err := report_codec.DeployReportCodec(transactor, simulatedBackend)
182187
require.NoError(t, err)

core/capabilities/ccip/ccipevm/msghasher_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"math/rand"
1414
"strings"
1515
"testing"
16-
1716
"time"
1817

1918
"github.com/ethereum/go-ethereum/accounts/abi/bind"

0 commit comments

Comments
 (0)