()
| 201 | |
| 202 | #[test] |
| 203 | fn evict_cold() { |
| 204 | let mut cache = RecentWindowCache::new(1_000_000, 3_600_000); |
| 205 | // Old partition: max_ts=2000, will be cold at now=10_000_000. |
| 206 | cache.insert(T1, "m", make_partition(1000, 2000, 10)); |
| 207 | // Recent partition: max_ts=9_000_000, within hot window at now=10_000_000. |
| 208 | cache.insert(T1, "m", make_partition(8_000_000, 9_000_000, 10)); |
| 209 | assert_eq!(cache.len(), 2); |
| 210 | |
| 211 | cache.evict_cold(10_000_000); |
| 212 | assert_eq!(cache.len(), 1); |
| 213 | assert!(cache.get(T1, "m", 1000).is_none()); // Evicted (cold). |
| 214 | assert!(cache.get(T1, "m", 8_000_000).is_some()); // Kept (hot). |
| 215 | } |
| 216 | |
| 217 | #[test] |
| 218 | fn evict_tenant() { |
nothing calls this directly
no test coverage detected