litellm/tests/proxy_behavior/auth
Cursor Agent 2ae1cf608f
test(auth): freeze prefetch cache clock so the org getter cannot miss on a slow runner
Backport of f4e21430c0 (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>
2026-09-15 19:16:31 +00:00
..
__init__.py perf(auth): read user, team, membership, org, project and spend counters in one MGET, one query and one pipeline (#40834) 2026-09-12 08:52:23 -07:00
conftest.py perf(auth): read user, team, membership, org, project and spend counters in one MGET, one query and one pipeline (#40834) 2026-09-12 08:52:23 -07:00
test_auth_object_prefetch.py test(auth): freeze prefetch cache clock so the org getter cannot miss on a slow runner 2026-09-15 19:16:31 +00:00