Skip to content

test: assert expired key directly now that time-machine controls clock#103

Merged
27Bslash6 merged 1 commit intomainfrom
fix/ttl-test-workaround
May 2, 2026
Merged

test: assert expired key directly now that time-machine controls clock#103
27Bslash6 merged 1 commit intomainfrom
fix/ttl-test-workaround

Conversation

@27Bslash6
Copy link
Copy Markdown
Contributor

@27Bslash6 27Bslash6 commented May 2, 2026

Summary

Test plan

  • test_ttl_enforced passes locally (verified 5/5 runs)
  • CI passes

Summary by CodeRabbit

Release Notes

No user-facing changes in this release. This update includes internal test improvements to verify existing functionality.

Removes workaround for file handle bug — with time-machine
shifting the clock, backend.get() correctly returns None for
expired keys. Closes #95.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 22c3df82-67f8-4aa8-9a73-879e29ef84d1

📥 Commits

Reviewing files that changed from the base of the PR and between 4fb674b and 5c56397.

📒 Files selected for processing (1)
  • tests/critical/test_file_backend_critical.py

📝 Walkthrough

Walkthrough

The test test_ttl_enforced was simplified to directly assert that an expired key returns None after the clock advances past its TTL, replacing a prior workaround that avoided reading the expired key and instead validated behavior through a separate key write/read cycle.

Changes

TTL Expiry Test Simplification

Layer / File(s) Summary
Test Improvement
tests/critical/test_file_backend_critical.py
test_ttl_enforced now directly asserts backend.get("temporary") is None after advancing past the TTL, removing the workaround that skipped reading the expired key.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

🐰 A rabbit hops through test code neat,
Where workarounds once dodged the heat.
Now TTL truth shines crystal clear—
Direct assertions, no tricks here!
Expired keys return None, sincere. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description includes Summary and Test plan sections, but omits required template sections like Motivation, Type of Change, and various checklists. Add missing required sections: Motivation (explain why the workaround removal is needed), Type of Change (select appropriate category), and complete relevant checklists per the template.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: removing a workaround and asserting expired keys directly now that time-machine controls the clock.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ttl-test-workaround

Review rate limit: 3/5 reviews remaining, refill in 18 minutes and 29 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@27Bslash6 27Bslash6 merged commit ed23317 into main May 2, 2026
32 checks passed
@27Bslash6 27Bslash6 deleted the fix/ttl-test-workaround branch May 2, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant