Skip to content

Commit e2f2cd6

Browse files
authored
fix: Wait for ring convergence in TestQueryFrontendResponseSizeLimit (#7490)
The test was flaky because it pushed samples before the distributor discovered the ingester in the ring, causing 'InstancesCount <= 0' errors. Add WaitSumMetrics on cortex_ring_tokens_total to ensure the distributor sees the ingester's tokens before pushing. Signed-off-by: Ben Ye <benye@amazon.com>
1 parent 2c60463 commit e2f2cd6

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

integration/query_frontend_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,9 @@ func TestQueryFrontendResponseSizeLimit(t *testing.T) {
989989
require.NoError(t, s.StartAndWaitReady(distributor, ingester, querier))
990990
require.NoError(t, s.WaitReady(queryFrontend))
991991

992+
// Wait until the distributor has discovered the ingester in the ring.
993+
require.NoError(t, distributor.WaitSumMetrics(e2e.Equals(512), "cortex_ring_tokens_total"))
994+
992995
c, err := e2ecortex.NewClient(distributor.HTTPEndpoint(), "", "", "", "user-1")
993996
require.NoError(t, err)
994997

0 commit comments

Comments
 (0)