Repository navigation
RED-213286: Extend BLESS eviction tests to every maxmemory policy - #15996
Conversation
Cover the policies and eviction paths that tests/unit/bless.tcl did not exercise yet: - Protection under volatile-lfu, volatile-lrm and allkeys-lrm (added to the existing per-policy loops). - The all-blessed bounded overshoot (tolerated within 1.25x maxmemory, OOM past it, BLESS CLEAR relieves it) under all nine evicting policies instead of allkeys-random only. Keys get a TTL under volatile-*. - Time-sliced eviction: lazyfree-lazy-eviction yes with maxmemory-eviction-tenacity 0. - No overshoot when no blessed key is an eviction candidate (noeviction, and volatile-lru with blessed keys that have no TTL): the plain maxmemory limit applies. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #15996 +/- ##
============================================
+ Coverage 78.15% 78.23% +0.07%
============================================
Files 155 155
Lines 90139 90178 +39
============================================
+ Hits 70448 70548 +100
+ Misses 19691 19630 -61 🚀 New features to boost your workflow:
|
gabsow
left a comment
There was a problem hiding this comment.
Reviewed the test changes and found no blocking issues. The added cases cover the nine eviction policies, lazy eviction, and the no-candidate OOM behavior; the TTL setup for volatile-* cases and Tcl argument expansion look correct. I did not run the suite locally; the PR reports unit/bless passed on macOS arm64.
Per review: put the new foreach wrappers at column 0 instead of re-indenting the wrapped tests, so the diff only shows the actual changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit f3a14b3. Configure here.
evicted_keys is a stat and FLUSHALL doesn't reset it, so in the foreach loops a later case could pass `evicted_keys > 0` on evictions from an earlier one. Run CONFIG RESETSTAT at the start of each case, as the LRU-pool test already does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@sundb WDYT now ? |

Test-only change to
tests/unit/bless.tcl. It covers the eviction policies and paths that the BLESS suite added in #15649 didn't exercise yet. No server code changes.What's added
volatile-lfu,volatile-lrm,allkeys-lrm)maxmemory, OOM past it,BLESS CLEARrelieves it)allkeys-randomonly, plus a separateallkeys-lrucasevolatile-*lazyfree-lazy-eviction yeswithmaxmemory-eviction-tenacity 0noeviction, andvolatile-lruwith blessed keys that have no TTL: the plainmaxmemorylimit appliesMost of the additions wrap existing tests in
foreachloops rather than copying them. Per review, the loops sit at column 0 so the wrapped tests keep their original indentation (+51 / −9). A few existing test names gain a($policy)or(lazyfree-lazy-eviction ...)suffix.Note on the "no overshoot" case
The eviction docs say the overshoot tolerance "applies uniformly across every
maxmemory-policyvalue". In the code, the tolerance only applies when eviction sampled keys and found that all of them were blessed (blessed_blocked). Withnoeviction, or undervolatile-*when the blessed keys have no TTL, nothing is sampled, so writes get a plain OOM. The new test pins the current code behavior. If that's the intended behavior, the docs wording could be narrowed.Testing
./runtest --single unit/blessonunstable@ 5e332ca (macOS arm64): all 48 cases pass, plus the memory-leak checks.Found while working on RED-213286 (BLESS OSS test coverage).
🤖 Generated with Claude Code
Note
Low Risk
Changes are limited to unit tests in
bless.tclwith no production code paths modified.Overview
Test-only expansion of
tests/unit/bless.tclmaxmemory/BLESS eviction scenarios—no server changes.The memory-pressure case now runs for both
lazyfree-lazy-evictionno and yes (withmaxmemory-eviction-tenacity 0on the lazy path), and several tests callconfig resetstatsoevicted_keysassertions are not polluted by earlier cases.All-blessed 1.25× overshoot behavior (tolerate within factor, OOM beyond, recover via
BLESS CLEAR) is parameterized across all nine evictingmaxmemory-policyvalues, with TTLs on keys when usingvolatile-*. New cases assert no overshoot tolerance when nothing blessed is an eviction candidate (noeviction, andvolatile-lruwith blessed keys that have no TTL).TTL protection and pool-branch eviction floods add
volatile-lfu,volatile-lrm, andallkeys-lrm; existing single-policy tests are mostly folded intoforeachloops with policy names in test titles.Reviewed by Cursor Bugbot for commit c3654b2. Bugbot is set up for automated code reviews on this repo. Configure here.