Repository navigation
test(auth): freeze the cache clock in auth prefetch tests - #41252
Closed
cursor[bot] wants to merge 6 commits into
Closed
cursor[bot] wants to merge 6 commits into
cursor[bot] wants to merge 6 commits into
Conversation
…nd Model Hub UI Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…mutation Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ow read fails Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
feat(model_hub): surface model_info.description in Model Hub
…_on_failed_read fix(health): skip background health check DB writes when the latest-row read fails
The org cache entries written by prefetch_auth_objects carry the 5s DEFAULT_IN_MEMORY_TTL. The first @log_db_metrics getter lazily imports litellm.proxy.proxy_server, which on a cold CI runner can take longer than 5s, so the org entry expired before get_org_object read it and the getter fell through to the MagicMock database. Inject a frozen clock into InMemoryCache so the test asserts the join, not import latency. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> (cherry picked from commit db79226)
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
devin-ai-integration
Bot
changed the base branch from
litellm_internal_staging
to
main
September 23, 2026 14:34
|
|
Contributor
|
Main already has the frozen cache clock for the prefetch tests from #40996, and the other commits here merged already. Reopen if something is missing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
Problem this solves:
How it solves it:
User Flow
Before: a developer pushing to litellm_internal_staging watches Postgres Tests / proxy-behavior fail on a slow CI runner
TypeError: object MagicMock can't be used in 'await' expressionfrom test_join_binds_the_membership_to_the_requested_teamAfter: the same push turns proxy-behavior green
Relevant issues
Affected release
Linear ticket
Pre-Submission checklist
Screenshots / Proof of Fix
Before (af6dc1d)
FAILED tests/proxy_behavior/auth/test_auth_object_prefetch.py::test_join_binds_the_membership_to_the_requested_team - TypeError: object MagicMock can't be used in 'await' expressionlitellm/proxy/auth/auth_checks.py:3798: in get_org_object, meaning the org getter fell through the cache and awaited a MagicMockAfter (a30ab84)
InMemoryCache(clock=lambda: 1_000_000.0), so the 5s org TTL cannot expire mid-testType
✅ Test
Caveats (if any)
Final Attestation