mirror of
https://github.com/headroomlabs-ai/headroom.git
synced 2026-11-22 13:29:19 +08:00
test(cache): make purge insertion eligible after setup (#3790)
## Summary Fix the release-blocking SQLite purge test fixture. Its setup performs several stores (which advances the backend's intentional 60-second purge throttle), then manually backdates one row and expects the immediately following insert to purge it. Explicitly reset the purge eligibility after backdating so the assertion tests metadata-only purge behavior rather than suite timing. ## Validation - Focused regression: 1 passed - Full SQLite backend file: 23 passed, 4 skipped - Ruff: clean - git diff --check: clean
This commit is contained in:
@@ -213,6 +213,10 @@ class TestSQLiteBackend:
|
||||
assert expired is not None
|
||||
expired.created_at = time.time() - 11
|
||||
backend.set(expired_hash, expired)
|
||||
# The setup stores above intentionally exercised the periodic purge and
|
||||
# advanced its 60-second throttle. Make the insertion under test eligible
|
||||
# to purge the row we only just backdated.
|
||||
backend._last_purge = 0.0
|
||||
|
||||
monkeypatch.setattr(
|
||||
backend,
|
||||
|
||||
Reference in New Issue
Block a user