Fix flaky TestQueryFrontendResponseSizeLimit: wait for ring convergence#7490
Open
yeya24 wants to merge 1 commit intocortexproject:masterfrom
Open
Fix flaky TestQueryFrontendResponseSizeLimit: wait for ring convergence#7490yeya24 wants to merge 1 commit intocortexproject:masterfrom
yeya24 wants to merge 1 commit intocortexproject:masterfrom
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does:
Wait for the distributor to discover the ingester in the ring before pushing samples in
TestQueryFrontendResponseSizeLimit.Why:
The test was flaky because
StartAndWaitReadyonly ensures the HTTP endpoint is healthy, not that the distributor has discovered the ingester's tokens in the hash ring. This caused intermittentDoBatch: InstancesCount <= 0errors (HTTP 500 on push).Fix:
Added
distributor.WaitSumMetrics(e2e.Equals(512), "cortex_ring_tokens_total")before the push loop, consistent with other integration tests in the same file (e.g., lines 323, 490, 583).