-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
integration-tests/deployment/ccip: fix assertion fns #14482
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7344b9f
integration-tests/deployment/ccip: fix assertion fns
makramkd 1a67785
fix stringer
makramkd cacaacd
Merge branch 'develop' into mk/fix-flakey-ccip-test
makramkd 28cf284
use getExecutionState to assert test condition
makramkd cb2ea3c
Merge branch 'develop' into mk/fix-flakey-ccip-test
makramkd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,14 +37,20 @@ func ConfirmCommitForAllWithExpectedSeqNums( | |
srcChain := srcChain | ||
dstChain := dstChain | ||
wg.Go(func() error { | ||
return func(src, dest uint64) error { | ||
var startBlock *uint64 | ||
if startBlocks != nil { | ||
startBlock = startBlocks[dest] | ||
} | ||
return ConfirmCommitWithExpectedSeqNumRange(t, srcChain, dstChain, state.Chains[dest].OffRamp, startBlock, | ||
ccipocr3.SeqNumRange{ccipocr3.SeqNum(expectedSeqNums[dest]), ccipocr3.SeqNum(expectedSeqNums[dest])}) | ||
}(src, dest) | ||
var startBlock *uint64 | ||
if startBlocks != nil { | ||
startBlock = startBlocks[dstChain.Selector] | ||
} | ||
return ConfirmCommitWithExpectedSeqNumRange( | ||
t, | ||
srcChain, | ||
dstChain, | ||
state.Chains[dstChain.Selector].OffRamp, | ||
startBlock, | ||
ccipocr3.SeqNumRange{ | ||
ccipocr3.SeqNum(expectedSeqNums[dstChain.Selector]), | ||
ccipocr3.SeqNum(expectedSeqNums[dstChain.Selector]), | ||
}) | ||
}) | ||
} | ||
} | ||
|
@@ -131,16 +137,18 @@ func ConfirmExecWithSeqNrForAll( | |
srcChain := srcChain | ||
dstChain := dstChain | ||
wg.Go(func() error { | ||
return func(src, dest deployment.Chain) error { | ||
var startBlock *uint64 | ||
if startBlocks != nil { | ||
startBlock = startBlocks[dest.Selector] | ||
} | ||
return ConfirmExecWithSeqNr( | ||
t, src, dest, state.Chains[dest.Selector].OffRamp, startBlock, | ||
expectedSeqNums[dstChain.Selector], | ||
) | ||
}(srcChain, dstChain) | ||
var startBlock *uint64 | ||
if startBlocks != nil { | ||
startBlock = startBlocks[dstChain.Selector] | ||
} | ||
return ConfirmExecWithSeqNr( | ||
t, | ||
srcChain, | ||
dstChain, | ||
state.Chains[dstChain.Selector].OffRamp, | ||
startBlock, | ||
expectedSeqNums[dstChain.Selector], | ||
) | ||
}) | ||
} | ||
} | ||
|
@@ -185,19 +193,36 @@ func ConfirmExecWithSeqNr( | |
if err != nil { | ||
return fmt.Errorf("error to get source chain config : %w", err) | ||
} | ||
t.Logf("Waiting for ExecutionStateChanged on chain %d from chain %d with expected sequence number %d, current onchain minSeqNr: %d", | ||
dest.Selector, source.Selector, expectedSeqNr, scc.MinSeqNr) | ||
executionState, err := offRamp.GetExecutionState(nil, source.Selector, expectedSeqNr) | ||
if err != nil { | ||
return fmt.Errorf("error to get execution state : %w", err) | ||
} | ||
t.Logf("Waiting for ExecutionStateChanged on chain %d (offramp %s) from chain %d with expected sequence number %d, current onchain minSeqNr: %d, execution state: %s", | ||
dest.Selector, offRamp.Address().String(), source.Selector, expectedSeqNr, scc.MinSeqNr, executionStateToString(executionState)) | ||
Comment on lines
+200
to
+201
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding these logs to aid in test debugging - in case the log fetching is (for whatever reason) not working. |
||
case execEvent := <-sink: | ||
if execEvent.SequenceNumber == expectedSeqNr && execEvent.SourceChainSelector == source.Selector { | ||
t.Logf("Received ExecutionStateChanged on chain %d from chain %d with expected sequence number %d", | ||
dest.Selector, source.Selector, expectedSeqNr) | ||
t.Logf("Received ExecutionStateChanged on chain %d (offramp %s) from chain %d with expected sequence number %d", | ||
dest.Selector, offRamp.Address().String(), source.Selector, expectedSeqNr) | ||
return nil | ||
} | ||
case <-timer.C: | ||
return fmt.Errorf("timed out waiting for ExecutionStateChanged on chain %d from chain %d with expected sequence number %d", | ||
dest.Selector, source.Selector, expectedSeqNr) | ||
return fmt.Errorf("timed out waiting for ExecutionStateChanged on chain %d (offramp %s) from chain %d with expected sequence number %d", | ||
dest.Selector, offRamp.Address().String(), source.Selector, expectedSeqNr) | ||
case subErr := <-subscription.Err(): | ||
return fmt.Errorf("Subscription error: %w", subErr) | ||
return fmt.Errorf("subscription error: %w", subErr) | ||
} | ||
} | ||
} | ||
|
||
func executionStateToString(state uint8) string { | ||
switch state { | ||
case 0: | ||
return "UNTOUCHED" | ||
case 1: | ||
return "IN_PROGRESS" | ||
case 2: | ||
return "SUCCESS" | ||
default: | ||
return "FAILURE" | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Input should probably be
expectedSeqNums map[uint64]SeqNumRange
since we'll need that eventually.