Fix flakiness in shard cache TTL tests by SungJin1212 · Pull Request #7667 · cortexproject/cortex · GitHub
Skip to content

Fix flakiness in shard cache TTL tests#7667

Open
SungJin1212 wants to merge 1 commit into
masterfrom
fix/shard-cache-ttl-test-flakiness
Open

Fix flakiness in shard cache TTL tests#7667
SungJin1212 wants to merge 1 commit into
masterfrom
fix/shard-cache-ttl-test-flakiness

Conversation

@SungJin1212

@SungJin1212 SungJin1212 commented Jul 3, 2026

Copy link
Copy Markdown
Member

What this PR does:
Fixes the flaky Test_Cache_TTLEvictionByLoop test
https://github.com/cortexproject/cortex/actions/runs/28488355152/job/84439538193?pr=7535 reports Test_Cache_TTLEvictionByLoop is flaky.

Why it was flaky

The test slept a fixed 150ms and then asserted the maintenance loop had already evicted the entry, but with TTL and MaintenanceInterval both at 100ms, scheduler jitter under CI load could push the eviction to the next tick (~200ms).

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]
  • docs/configuration/v1-guarantees.md updated if this PR introduces experimental flags

Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant