Skip to content

Commit

Permalink
replace contains with equals (#1385)
Browse files Browse the repository at this point in the history
## Motivation

When simulating slow load on testnet, the load gen was getting applied
to multiple networks.


## Solution

Replace contains check with EqualFold. Also add some logs to make it
easier to understand.
  • Loading branch information
anirudhwarrier authored Aug 28, 2024
1 parent a3f61f7 commit 6fe155b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion integration-tests/ccip-tests/load/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,15 @@ func (l *LoadArgs) scheduleForDest(destNetworkName string) []*wasp.Segment {
// if found, use that frequency for the destination network
// otherwise, use the default frequency
if l.TestCfg.TestGroupInput.LoadProfile.FrequencyByDestination != nil {
l.lggr.Debug().
Interface("FrequencyByDestination", l.TestCfg.TestGroupInput.LoadProfile.FrequencyByDestination).
Msg("LoadProfile provided")
for networkName, freq := range l.TestCfg.TestGroupInput.LoadProfile.FrequencyByDestination {
if strings.Contains(destNetworkName, strings.ToLower(networkName)) {
l.lggr.Debug().Str("Destination", destNetworkName).Str("NetworkName", networkName).Msg("Checking frequency for destination")
if strings.EqualFold(destNetworkName, networkName) {
l.lggr.Info().Str("Destination", destNetworkName).
Ints64("RequestPerUnitTime", freq.RequestPerUnitTime).
Msg("Using frequency for destination")
return WaspSchedule(
freq.RequestPerUnitTime,
l.TestCfg.TestGroupInput.LoadProfile.TestDuration,
Expand Down

0 comments on commit 6fe155b

Please sign in to comment.