Skip to content

Commit

Permalink
remove random shuffling while forming network pair
Browse files Browse the repository at this point in the history
  • Loading branch information
AnieeG committed Jul 2, 2024
1 parent 9cce1dd commit 521e070
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion integration-tests/ccip-tests/testconfig/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ Specifies the number of routers to be set up for each network.

### CCIP.Groups.[testgroup].MaxNoOfLanes
Specifies the maximum number of lanes to be set up between networks. If this values is not set, the test will set up lanes between all possible pairs of networks mentioned in `selected_networks` in [CCIP.Env.Networks](#ccipenvnetworksselectednetworks).
For example, if `selected_networks = ['SIMULATED_1', 'SIMULATED_2', 'SIMULATED_3']`, and `MaxNoOfLanes` is set to 3, it denotes that the test will randomly select 3 lanes between all possible pairs `SIMULATED_1`, `SIMULATED_2`, and `SIMULATED_3` for the test run.
For example, if `selected_networks = ['SIMULATED_1', 'SIMULATED_2', 'SIMULATED_3']`, and `MaxNoOfLanes` is set to 2, it denotes that the test will select the first 2 lanes between all possible pairs `SIMULATED_1`, `SIMULATED_2`, and `SIMULATED_3` for the test run.

### CCIP.Groups.[testgroup].ChaosDuration
Specifies the duration for which the chaos experiment is to be run. This is only valid if the test type is 'chaos'.
Expand Down
6 changes: 1 addition & 5 deletions integration-tests/ccip-tests/testsetups/ccip.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"math/big"
"math/rand"
"os"
"regexp"
"strings"
Expand Down Expand Up @@ -286,11 +285,8 @@ func (c *CCIPTestConfig) SetNetworkPairs(lggr zerolog.Logger) error {
c.AddPairToNetworkList(c.SelectedNetworks[0], c.SelectedNetworks[1])
}

// if the number of lanes is lesser than the number of network pairs, choose a random subset of network pairs
// if the number of lanes is lesser than the number of network pairs, choose first c.TestGroupInput.MaxNoOfLanes pairs
if c.TestGroupInput.MaxNoOfLanes > 0 && c.TestGroupInput.MaxNoOfLanes < len(c.NetworkPairs) {
rand.Shuffle(len(c.NetworkPairs), func(i, j int) {
c.NetworkPairs[i], c.NetworkPairs[j] = c.NetworkPairs[j], c.NetworkPairs[i]
})
c.NetworkPairs = c.NetworkPairs[:c.TestGroupInput.MaxNoOfLanes]
}

Expand Down

0 comments on commit 521e070

Please sign in to comment.