Commit 052b1e2
committed
test: cover empty-heap exit branch in _async_evict_oldest
``_async_evict_oldest`` falls through to a silent return if
``_expire_heap`` is empty. By the cache invariant every record
counted in ``_total_records`` has a heap entry, so this branch is
unreachable in normal operation — but it's a defense-in-depth path
worth pinning. Force the broken state directly
(``_total_records = MAX, _expire_heap = []``) and verify eviction
returns gracefully while the subsequent insert still completes.1 parent 7c6be63 commit 052b1e2
1 file changed
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
519 | 519 | | |
520 | 520 | | |
521 | 521 | | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
522 | 535 | | |
523 | 536 | | |
524 | 537 | | |
| |||
0 commit comments