Fix sol test adapter#22359
Conversation
|
✅ No conflicts with other open PRs targeting |
|
There was a problem hiding this comment.
Pull request overview
Risk Rating: MEDIUM
This PR refines Solana-related CCIP test helpers by making event polling more responsive and improving timeout/log diagnostics, and also adjusts messaging test helper behavior around replay timing and (intended) Solana start-slot selection.
Changes:
- Reduced Solana event polling interval from 2s to 1s and added more informative “waiting/elapsed” logs and timeout errors in
test_adapter_svm.go. - Added logic in messaging tests intended to set a Solana destination
startBlockto avoid scanning historical transactions. - Shortened
SleepAndReplaydelay when either source or destination chain is Solana.
Areas requiring scrupulous human review:
messagingtest/helpers.gostart-block capture: currently relies on an interface method that is not implemented anywhere, so the optimization does not take effect.- Replay timing change (30s → 10s for Solana-involved tests): verify it doesn’t introduce flakiness in environments where logpoller/indexing latency is higher.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| deployment/ccip/changeset/testhelpers/test_adapter_svm.go | More frequent Solana event polling and improved logging/timeout diagnostics for commit/exec event waits. |
| deployment/ccip/changeset/testhelpers/messagingtest/helpers.go | Attempts to set Solana start slot for destination validation and tweaks replay sleep duration for Solana paths. |
CORA - Pending Reviewers
Legend: ✅ Approved | ❌ Changes Requested | 💬 Commented | 🚫 Dismissed | ⏳ Pending | ❓ Unknown For more details, see the full review summary. |
|




Fix flaky Solana↔EVM integration tests — startBlock capture and SolEventEmitter hardening
Problem
Test_CCIPMessaging_EVM2SolanaandTest_CCIPMessaging_Solana2EVMfrequently timeout at 30 minutes on first CI run but pass quickly on retry. The root cause isSolEventEmitterscanning all historical transactions from slot 0, which can include setup noise that delays or blocks event discovery.Root Cause
When
startBlockis nil (the default for Solana dest chains),SolEventEmitterscans from slot 0, processing every transaction ever sent to the OffRamp address. On first run with a fresh environment, this includes deployment and configuration transactions that slow down event discovery. On retry, timing differences or cached state allow it to pass quickly.Changes
startBlock capture for Solana dest chains (
deployment/ccip/changeset/testhelpers/messagingtest/helpers.go)currentBlockerinterface assertion on the dest adapter. This tellsSolEventEmitterto skip all transactions before the message was sent.SleepAndReplayduration from 30s to 10s for Solana lanes since Solana finality is faster than EVM.SolEventEmitter hardening (
deployment/ccip/changeset/testhelpers/test_adapter_svm.go)CurrentBlockmethod toSVMAdapterthat returns the current finalized slot.isTransientSolanaRPCErrorfunction to gracefully handle transient RPC errors like "Transaction not found" (code -32020) instead of crashing the test.GetSignaturesForAddressWithOptsandGetTransactioncalls.batchCompletedtracking: when a transientGetTransactionerror occurs mid-batch, the cursor is not advanced, ensuring the batch is retried on the next tick instead of permanently skipping events.case <-ctx.Done()to the main select loop for prompt goroutine exit on context cancellation.errorCh <- errsends inselect { case errorCh <- err: case <-done: }to prevent goroutine leaks.require.Equalfor source chain selector with an if-check + log + continue, so commit reports from other source chains are gracefully skipped instead of failing the test.Related PR