Skip to content

Commit

Permalink
fix(ci): fix two flakey interchaintests (#3480)
Browse files Browse the repository at this point in the history
* fix(ci): Fix for the feemarket test misconfiguring validators

* fix(ci): fix a flake in the config test
  • Loading branch information
fastfadingviolets authored Jan 13, 2025
1 parent eecf11b commit 26fec1c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion tests/interchain/chainsuite/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ func (c *Chain) ModifyConfig(ctx context.Context, testName interchaintest.TestNa
eg := errgroup.Group{}
if len(validators) == 0 {
validators = make([]int, len(c.Validators))
for _, valIdx := range validators {
for valIdx := range validators {
validators[valIdx] = valIdx
}
}
Expand All @@ -486,5 +486,6 @@ func (c *Chain) ModifyConfig(ctx context.Context, testName interchaintest.TestNa
if err := eg.Wait(); err != nil {
return err
}
time.Sleep(30 * time.Second)
return nil
}
13 changes: 8 additions & 5 deletions tests/interchain/validator/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func (s *ConfigSuite) TestNoIndexingTransactions() {
s.Require().NoError(err)
tx := cosmos.CosmosTx{}
s.Require().NoError(json.Unmarshal(stdout, &tx))
s.Require().Equal(0, tx.Code, tx.RawLog)
s.Require().NoError(testutil.WaitForBlocks(s.GetContext(), 2, s.Chain))

txResult, err := s.Chain.Validators[1].GetTransaction(
Expand Down Expand Up @@ -114,20 +115,22 @@ func (s *ConfigSuite) TestPeerLimit() {
}
s.Require().NoError(s.Chain.Validators[0].SetPeers(s.GetContext(), ""))

s.Require().NoError(s.Chain.StopAllNodes(s.GetContext()))
s.Require().NoError(s.Chain.StartAllNodes(s.GetContext()))
s.Require().NoError(testutil.WaitForBlocks(s.GetContext(), 2, s.Chain))

p2p := make(testutil.Toml)
p2p["max_num_inbound_peers"] = 2
// disable pex so that we can control the number of peers
// p2p["pex"] = false
p2p["pex"] = false
configToml := make(testutil.Toml)
configToml["p2p"] = p2p
err = s.Chain.ModifyConfig(
s.GetContext(), s.T(),
map[string]testutil.Toml{"config/config.toml": configToml},
0,
)
if err != nil {
// it's okay if one of the nodes has 0 peers and fails to start
s.Require().Contains(err.Error(), "still catching up")
}
s.Require().NoError(err)

s.Require().NoError(testutil.WaitForBlocks(s.GetContext(), 4, s.Chain))

Expand Down

0 comments on commit 26fec1c

Please sign in to comment.