From 5f36263548928d9256d770b08634405dc81b6244 Mon Sep 17 00:00:00 2001 From: Alex | Interchain Labs Date: Mon, 17 Mar 2025 09:25:32 -0400 Subject: [PATCH] chore: attempt to fix flakey test (#24009) --- client/rpc/rpc_test.go | 5 ++++- testutil/network/network.go | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/client/rpc/rpc_test.go b/client/rpc/rpc_test.go index bffdbf927d..96c2c2c643 100644 --- a/client/rpc/rpc_test.go +++ b/client/rpc/rpc_test.go @@ -87,7 +87,10 @@ func (s *IntegrationTestSuite) TestQueryABCIHeight() { for _, tc := range testCases { s.Run(tc.name, func() { - s.network.WaitForHeight(tc.expHeight) + gotHeight, err := s.network.WaitForHeight(tc.expHeight) + if gotHeight != tc.expHeight { + s.Fail(err.Error()) + } val := s.network.Validators[0] diff --git a/testutil/network/network.go b/testutil/network/network.go index ac6d4593d3..1d9f600196 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -703,7 +703,7 @@ func (n *Network) LatestHeight() (int64, error) { // committed after a given block. If that height is not reached within a timeout, // an error is returned. Regardless, the latest height queried is returned. func (n *Network) WaitForHeight(h int64) (int64, error) { - return n.WaitForHeightWithTimeout(h, 10*time.Second) + return n.WaitForHeightWithTimeout(h, 20*time.Second) } // WaitForHeightWithTimeout is the same as WaitForHeight except the caller can @@ -745,7 +745,7 @@ func (n *Network) WaitForHeightWithTimeout(h int64, t time.Duration) (int64, err // blocks has been reached. func (n *Network) RetryForBlocks(retryFunc func() error, blocks int) error { for i := 0; i < blocks; i++ { - n.WaitForNextBlock() + _ = n.WaitForNextBlock() // ignore the error as we use the retry for validation err := retryFunc() if err == nil { return nil