Repository navigation
test(auth): freeze prefetch cache clock so the org getter cannot miss on a slow runner - #41278
Draft
cursor[bot] wants to merge 6 commits into
Draft
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
… on a slow runner Backport of f4e2143 (originally on main via PR #41102). The org cache entries written by prefetch_auth_objects carry the 5s DEFAULT_IN_MEMORY_TTL, so on a slow CI runner the entry expires before get_org_object reads it and the getter falls through to the MagicMock database, producing a TypeError: object MagicMock can't be used in 'await' expression at tests/proxy_behavior/auth/test_auth_object_prefetch.py::test_join_binds_the_membership_to_the_requested_team. Inject a frozen clock into InMemoryCache so the test asserts the SQL join, not import or scheduler latency. Co-authored-by: Krrish Dholakia <krrish-berri-2@users.noreply.github.com>
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
5 of 6 tasks
This was referenced Sep 16, 2026
devin-ai-integration
Bot
changed the base branch from
litellm_internal_staging
to
main
September 23, 2026 14:34
This branch has not been deployed
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:
litellm_internal_stagingsince perf(auth): read user, team, membership, org, project and spend counters in one MGET, one query and one pipeline #40834test_join_binds_the_membership_to_the_requested_teamintermittently trips a MagicMock await TypeErrorHow it solves it:
mainin fix(auth): load team membership once per request and skip prisma on an L1 hit #41102 (commitf4e21430c0)InMemoryCacheso the 5s org TTL cannot expire mid-testRelevant issues
Backport of #41102 to
litellm_internal_stagingLinear ticket
Type
✅ Test
Screenshots / Proof of Fix
All four
pushruns of the Postgres Tests workflow onlitellm_internal_stagingsince #40834 landed have failed on the same test:af6dc1db08)3f32a19d55)1f8bae7eab)8d5c165547)All four fail with the identical:
Root cause (quoted from the
mainfix commitf4e21430c0): the org cache entries written byprefetch_auth_objectscarry the 5sDEFAULT_IN_MEMORY_TTL. The first@log_db_metricsgetter lazily importslitellm.proxy.proxy_server, which on a cold CI runner can take longer than 5s, so the org entry expires beforeget_org_objectreads it and the getter falls through to the MagicMockdead_db, whosedb.litellm_organizationtable.find_unique(...)returns a non-awaitable MagicMock.Main has been green on the same workflow since the fix landed (e.g. run https://github.com/BerriAI/litellm/actions/runs/35010237987,
push mainat 2026-09-15 18:53Z, Postgres Tests succeeded).This PR is a mechanical backport of the exact test-only diff on
main, verified withgit diff origin/main -- tests/proxy_behavior/auth/test_auth_object_prefetch.pyreturning empty after the change.Caveats
Low
Final Attestation