Repository navigation
test(auth): freeze the prefetch join test cache clock - #41055
jibanez-staticduo wants to merge 1 commit into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Greptile SummaryThis test-only change injects a fixed clock into the prefetch join test's in-memory cache
Confidence Score: 5/5The PR appears safe to merge because the fixed clock removes timing sensitivity while preserving the test's behavioral assertions No actionable failures remain; incorrect prefetch data or cache keys would still fall through to the unusable database fixture and fail the test
|
| Filename | Overview |
|---|---|
| tests/proxy_behavior/auth/test_auth_object_prefetch.py | Freezes the test-local cache clock so cache-hit assertions remain deterministic without weakening coverage |
Reviews (1): Last reviewed commit: "test(auth): freeze the prefetch join tes..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
TLDR
Problem this solves:
How it solves it:
User Flow
Before: a contributor runs the auth prefetch join test on a slow runner and sees a cache-miss error
TypeError: object MagicMock can't be used in 'await' expressionAfter: the same contributor can run the test without depending on runner speed
Relevant issues
Found while diagnosing unrelated PR #41050: https://github.com/BerriAI/litellm/actions/runs/34821830089/job/103904913864
Affected release
Linear ticket
Pre-Submission checklist
Screenshots / Proof of Fix
This is a test-only timing fix. The reproduction uses the test suite's PostgreSQL fixture. Save the following temporary pytest plugin as
ttl_probe.pyoutside the checkout and add its directory toPYTHONPATH. It delays the organization getter without changing repository files or the cache clockBefore (30f33a9)
With the proxy-behavior test database configured, run the affected test with the temporary delay plugin
Observe the cache miss reach the deliberately unusable database fixture
After (0736d75)
Run the entire affected file with the same delay plugin
Observe the SQL join and cache-hit assertions pass despite the delay
Type
Test
Caveats (if any)
Low
The controlled delay reproduces the exact exception on both unchanged upstream and the unrelated reasoning PR. This demonstrates the test's timing sensitivity; it does not measure when the original CI entry expired. Production authentication and cache TTLs are unchanged. The affected test-tree Ruff and quality-budget checks pass
Final Attestation