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

fix(ci): fix two flakey interchaintests #3480

Merged
merged 2 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading