Skip to content

Commit

Permalink
Temporarily reducing number of validators for icad tests only (cosmos…
Browse files Browse the repository at this point in the history
  • Loading branch information
chatton authored Aug 25, 2022
1 parent 2c253fa commit 3b56956
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions e2e/testsuite/testsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,13 +329,28 @@ func (s *E2ETestSuite) createCosmosChains(chainOptions testconfig.ChainOptions)

logger := zaptest.NewLogger(s.T())

// TODO(chatton): allow for controller over number of validators and full nodes.
chainA := cosmos.NewCosmosChain(s.T().Name(), *chainOptions.ChainAConfig, 4, 1, logger)
chainB := cosmos.NewCosmosChain(s.T().Name(), *chainOptions.ChainBConfig, 4, 1, logger)
numValidators, numFullNodes := getValidatorsAndFullNodes(chainOptions)

chainA := cosmos.NewCosmosChain(s.T().Name(), *chainOptions.ChainAConfig, numValidators, numFullNodes, logger)
chainB := cosmos.NewCosmosChain(s.T().Name(), *chainOptions.ChainBConfig, numValidators, numFullNodes, logger)
return chainA, chainB
}

// getValidatorsAndFullNodes returns the number of validators and full nodes which should be used
// for the given chain config.
func getValidatorsAndFullNodes(chainOptions testconfig.ChainOptions) (int, int) {
// TODO: the icad tests are failing with a larger number of validators.
// this function can be removed once https://github.com/cosmos/ibc-go/issues/2104 is resolved.
numValidators := 4
numFullNodes := 1
isIcadImage := strings.Contains(chainOptions.ChainAConfig.Images[0].Repository, "icad")
if isIcadImage {
numValidators = 1
numFullNodes = 0
}
return numValidators, numFullNodes
}

// GetRelayerExecReporter returns a testreporter.RelayerExecReporter instances
// using the current test's testing.T.
func (s *E2ETestSuite) GetRelayerExecReporter() *testreporter.RelayerExecReporter {
Expand Down

0 comments on commit 3b56956

Please sign in to comment.