Handle an expired cache entry
Failing check python -m pytest -q tests/test_cache.py passed; 3 commands recorded in the session over 4m 0s, changes touched src/cache.py, tests/test_cache.py.
evidence
verified · the same recorded check failed and later passed
Scope: this verifies the recorded check, not the whole issue.
Root cause is not inferred by DebugBrief.
Red to green
failed at 2026-01-01T12:02:12Z
passed at 2026-01-01T12:04:12Z
These file changes are correlation, not proven cause.
src/cache.pytests/test_cache.py
Reproduce and verify
- Reproduce:
python -m pytest -q tests/test_cache.py - Verify:
python -m pytest -q tests/test_cache.py
Observed error
E AssertionError: expired entry returned instead of a cache miss
Verification
- passed
python -m pytest -q tests/test_cache.py - passed
python -m ruff check src tests
Changed files
- M ·
src/cache.py - M ·
tests/test_cache.py
Failed attempts
python -m pytest -q tests/test_cache.pyfailed
Notes
- Expired entries still reach the read path. Check the expiry boundary.
- Return a cache miss when the entry expires. Added the boundary case to the test.
Timeline
- 2026-01-01T12:02:00Z · snapshotSession started.
- 2026-01-01T12:02:12Z · commandpython -m pytest -q tests/test_cache.py -> failed (exit 1) [0.4s]
- 2026-01-01T12:03:00Z · noteExpired entries still reach the read path. Check the expiry boundary.
- 2026-01-01T12:04:00Z · noteReturn a cache miss when the entry expires. Added the boundary case to the test.
- 2026-01-01T12:04:12Z · commandpython -m pytest -q tests/test_cache.py -> passed (exit 0) [0.4s]
- 2026-01-01T12:05:12Z · commandpython -m ruff check src tests -> passed (exit 0) [0.08s]
- 2026-01-01T12:06:00Z · snapshotSession ended.
Command output
failed · python -m pytest -q tests/test_cache.py
E AssertionError: expired entry returned instead of a cache miss 1 failed
passed · python -m pytest -q tests/test_cache.py
4 passed
passed · python -m ruff check src tests
All checks passed!