Skip to content

SOLR-18583: [branch_9x] Fix TestCaffeineCache and TestThinCache testSimple failures with Caffein 3.3.0 - #5207

Merged
iamsanjay merged 1 commit into
apache:branch_9xfrom
iamsanjay:cache-tests-eviction-order-9x
Oct 23, 2026
Merged

iamsanjay merged 1 commit into
apache:branch_9xfrom
iamsanjay:cache-tests-eviction-order-9x

Conversation

@iamsanjay

@iamsanjay iamsanjay commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

TestCaffeineCache.testSimple and TestThinCache.testSimple asserted that
key 1 is evicted after 101 puts into a cache of size 100. Which entry is
evicted is up to Caffeine's eviction policy, not insertion order, and it
changed in Caffeine 3.3.0: both tests now fail on every branch_9x run.

Assert that exactly one entry was evicted instead, and drop the get(1)
lookup from the cumulative lookup count.

TestThinCache also warms the second cache into the shared backing cache
while it is still full. On Caffeine 3.3.0 the warmed entries lose to the
existing ones and are evicted, so enlarge the backing before warming
(the same change as SOLR-18506 / apache#5029).
@iamsanjay
iamsanjay merged commit fc4429a into apache:branch_9x Oct 23, 2026
4 checks passed
@iamsanjay iamsanjay self-assigned this Oct 24, 2026
@iamsanjay iamsanjay added this to the 9.x milestone Oct 24, 2026
@iamsanjay iamsanjay changed the title [branch_9x] Fix TestCaffeineCache and TestThinCache testSimple failures with Caffein 3.3.0 SOLR-18583: [branch_9x] Fix TestCaffeineCache and TestThinCache testSimple failures with Caffein 3.3.0 Oct 24, 2026
@dsmiley

dsmiley commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Backports should either have the same commit first line (wasn't true here due to different PR reference) and/or have the cherry-pick reference that should be there when git cherrypick -x (best practice; IDEs do this too) -- wasn't done here. Consequently an automatic backport mechanism like what I built can't auto-discern what's going on here.

@iamsanjay

Copy link
Copy Markdown
Contributor Author

This one isn't a backport actually: it's a branch_9x-only fix. Only branch_9x has Caffeine 3.3.0, so main/10x aren't affected and there's no main commit to reference (the main PR #5205 was closed).

@dsmiley

dsmiley commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Oh sorry I was confused. I'm surprised we wouldn't do this on main as well since we'll get to this version of Caffeine eventually.

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.

2 participants