Skip to content

Commit

Permalink
Little tweak maximumSize test in CaffeineClientSideCacheTest
Browse files Browse the repository at this point in the history
  • Loading branch information
sazzad16 committed Jun 30, 2024
1 parent f136c6f commit 3534996
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void individualCommandsAndThenStats() {
@Test
public void maximumSize() {
final long maxSize = 10;
final long maxEstimatedSize = 50;
final long maxEstimatedSize = 52;
int count = 1000;
for (int i = 0; i < count; i++) {
control.set("k" + i, "v" + i);
Expand All @@ -68,10 +68,10 @@ public void maximumSize() {
try (JedisPooled jedis = new JedisPooled(hnp, clientConfig.get(), new CaffeineClientSideCache(caffeine))) {
for (int i = 0; i < count; i++) {
jedis.get("k" + i);
assertThat(caffeine.estimatedSize(), Matchers.lessThanOrEqualTo(maxEstimatedSize));
assertThat(caffeine.estimatedSize(), Matchers.lessThan(maxEstimatedSize));
}
}
assertThat(caffeine.stats().evictionCount(), Matchers.greaterThanOrEqualTo(count - maxEstimatedSize));
assertThat(caffeine.stats().evictionCount(), Matchers.greaterThan(count - maxEstimatedSize));
}

@Test
Expand Down

0 comments on commit 3534996

Please sign in to comment.