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

Add ccip message assertion to e2e tests #1584

Open
wants to merge 11 commits into
base: ccip-develop
Choose a base branch
from
Prev Previous commit
Next Next commit
fix log
  • Loading branch information
joaoluisam committed Dec 26, 2024
commit a0c37b871d599771103d1be2a566e32b48b07192
12 changes: 6 additions & 6 deletions integration-tests/ccip-tests/actions/ccip_helpers.go
Original file line number Diff line number Diff line change
@@ -2654,7 +2654,7 @@ func (destCCIP *DestCCIPModule) AssertMessageContentMatch(
) error {
fmt.Println(reqStat)
lggr.Info().
Str("MsgID", fmt.Sprintf("0x%x", messageID)).
Str("MsgID", fmt.Sprintf("0x%x", string(messageID))).
Str("Timeout", timeout.String()).
Msg("Waiting for message content to match")
timer := time.NewTimer(timeout)
@@ -2674,23 +2674,23 @@ func (destCCIP *DestCCIPModule) AssertMessageContentMatch(
receivedContent, ok := value.([]uint8)
if !ok {
lggr.Warn().
Str("MsgID", fmt.Sprintf("0x%x", messageID)).
Str("MsgID", fmt.Sprintf("0x%x", string(messageID))).
Msg("Invalid content type in MessageReceivedWatcher")
continue
}

// Compare the received content with the expected content
if string(receivedContent) == string(expectedContent) {
lggr.Info().
Str("MessageID 0x%x", messageID).
Str("MessageID 0x%x", string(messageID)).
Str("Received Content", string(receivedContent)).
Str("Expected Content", string(expectedContent)).
Msg("Message received and its content matches the sent content")
return nil
}

lggr.Warn().
Str("MessageID 0x%x", messageID).
Str("MessageID 0x%x", string(messageID)).
Str("Received Content", string(receivedContent)).
Str("Expected Content", string(expectedContent)).
Msg("Message content mismatch")
@@ -2699,15 +2699,15 @@ func (destCCIP *DestCCIPModule) AssertMessageContentMatch(
// Handle timeout with potential connection issue recovery
if destCCIP.Common.IsConnectionRestoredRecently != nil && !destCCIP.Common.IsConnectionRestoredRecently.Load() {
if resetTimerCount > 2 {
return fmt.Errorf("possible RPC issue - message content did not match for MessageID 0x%x", messageID)
return fmt.Errorf("possible RPC issue - message content did not match for MessageID 0x%x", string(messageID))
}
timer.Reset(timeout)
resetTimerCount++
lggr.Info().Int("count of reset", resetTimerCount).Msg("Resetting timer to validate message content match")
continue
}

return fmt.Errorf("timeout - message was not received or content did not match for MessageID 0x%x", messageID)
return fmt.Errorf("timeout - message was not received or content did not match for MessageID 0x%x", string(messageID))
}
}
}
Loading