Skip to content

fix(test): increase simulated backend EVM timeout and use require for safe failure#21955

Open
Fletch153 wants to merge 2 commits intodevelopfrom
fix/CORE-2383-assert-require-panic
Open

fix(test): increase simulated backend EVM timeout and use require for safe failure#21955
Fletch153 wants to merge 2 commits intodevelopfrom
fix/CORE-2383-assert-require-panic

Conversation

@Fletch153
Copy link
Copy Markdown
Collaborator

@Fletch153 Fletch153 commented Apr 10, 2026

Summary

  • The go-ethereum simulated backend defaults to a 5-second RPCEVMTimeout for eth_call
  • Under -count=100 -race, race detector overhead (5-10x) causes EVM execution to exceed this timeout
  • Root cause fix: Create the simulated backend with RPCEVMTimeout: 60s so EVM calls complete reliably under load
  • Defensive fix: Change assert.NoErrorrequire.NoError before slice iteration so the test stops cleanly on any failure instead of panicking on an empty slice

Root Cause

testSetup() used backends.NewSimulatedBackend() which inherits go-ethereum's default 5s RPCEVMTimeout. The test calls contract.DecodeExecuteReport() which goes through eth_calldoCall()applyMessageWithEVM() — all subject to this timeout. Under race detector overhead, the 5s limit is exceeded intermittently.

Test plan

  • CI passes
  • No more execution aborted (timeout = 5s) panics under -count=100 -race

Fixes: CORE-2383

@github-actions
Copy link
Copy Markdown
Contributor

👋 Fletch153, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 10, 2026

✅ No conflicts with other open PRs targeting develop

@trunk-io
Copy link
Copy Markdown

trunk-io bot commented Apr 10, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@Fletch153 Fletch153 changed the title fix(test): use require instead of assert before slice access in executecodec test fix(test): increase simulated backend EVM timeout and use require for safe failure Apr 10, 2026
@Fletch153 Fletch153 force-pushed the fix/CORE-2383-assert-require-panic branch 6 times, most recently from b92e5b9 to 422e6c1 Compare April 10, 2026 20:04
…recation in ccipevm tests

- Replace assert with require before slice access in executecodec_test to avoid panics on failure
- Increase simulated backend EVM timeout from 5s to 60s in msghasher_test
- Replace deprecated backends.NewSimulatedBackend with simulated.NewBackend in both test files
@Fletch153 Fletch153 force-pushed the fix/CORE-2383-assert-require-panic branch from 422e6c1 to d492f58 Compare April 10, 2026 20:18
@Fletch153 Fletch153 requested review from MStreet3 and jmank88 April 13, 2026 12:38
@Fletch153 Fletch153 force-pushed the fix/CORE-2383-assert-require-panic branch from fa4ecbd to ddd75cd Compare April 13, 2026 12:49
…port 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.
@Fletch153 Fletch153 force-pushed the fix/CORE-2383-assert-require-panic branch from ddd75cd to 85c7cf5 Compare April 13, 2026 12:51
@cl-sonarqube-production
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants