Fix flaky TestCompactor_RingLifecyclerShouldAutoForgetUnhealthyInstances#7503
Merged
Conversation
…erShouldAutoForgetUnhealthyInstances The test was flaky because WaitActiveInstanceTimeout (5s from prepareConfig) was too tight when combined with WaitStabilityMinDuration=1s and WaitStabilityMaxDuration=5s. On slow CI machines, the ring lifecycler may not transition to ACTIVE within 5s, causing a context deadline exceeded error at StartAndAwaitRunning. Increase WaitActiveInstanceTimeout to 30s to give sufficient headroom for the ring to stabilize on slow CI environments. Signed-off-by: Ben Ye <benye@amazon.com>
SungJin1212
approved these changes
May 11, 2026
friedrichg
approved these changes
May 11, 2026
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
Increase
WaitActiveInstanceTimeoutfrom 5s to 30s inTestCompactor_RingLifecyclerShouldAutoForgetUnhealthyInstances.Why
The test was flaky on CI because
WaitActiveInstanceTimeout(5s fromprepareConfig) was too tight when combined withWaitStabilityMinDuration=1sandWaitStabilityMaxDuration=5s. On slow CI machines, the ring lifecycler may not transition to ACTIVE within 5s, causing acontext deadline exceedederror atStartAndAwaitRunning(line 2228).How
Override
WaitActiveInstanceTimeoutto 30s in this specific test, giving sufficient headroom for the ring to stabilize on slow CI environments.Testing
Ran the test 5 times locally — all passed (4-8s per run), confirming the original 5s timeout was too tight.
Fixes flaky test from: https://github.com/cortexproject/cortex/actions/runs/25645120563/job/75272471073