Skip to content

Fix flaky TestCompactor_RingLifecyclerShouldAutoForgetUnhealthyInstances#7503

Merged
friedrichg merged 1 commit into
masterfrom
fix-compactor-ring-flaky-test
May 11, 2026
Merged

Fix flaky TestCompactor_RingLifecyclerShouldAutoForgetUnhealthyInstances#7503
friedrichg merged 1 commit into
masterfrom
fix-compactor-ring-flaky-test

Conversation

@yeya24
Copy link
Copy Markdown
Contributor

@yeya24 yeya24 commented May 11, 2026

What

Increase WaitActiveInstanceTimeout from 5s to 30s in TestCompactor_RingLifecyclerShouldAutoForgetUnhealthyInstances.

Why

The test was flaky on CI 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 (line 2228).

How

Override WaitActiveInstanceTimeout to 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

…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>
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 11, 2026
@friedrichg friedrichg merged commit 55e300e into master May 11, 2026
37 checks passed
@friedrichg friedrichg deleted the fix-compactor-ring-flaky-test branch May 11, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/compactor lgtm This PR has been approved by a maintainer size/XS type/flaky-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants