litellm/tests/proxy_behavior
Cursor Agent 7fd2c3bb8a
test(auth): isolate prefetch assertions from cache expiry
The three Postgres prefetch tests warm the cache, then run a series of
per-object getters against a MagicMock stand-in for the DB, asserting
'getters must be served from the prefetched cache'. When the test's
real-time DB writes and prefetch round-trip exceed DEFAULT_IN_MEMORY_TTL
(5s), the org cache entry expires and get_org_object falls through to
the MagicMock, producing 'TypeError: object MagicMock can't be used in
await expression' at the assertion point.

Freeze the in-memory cache clock with clock=lambda: 0.0 so entries never
tick past their TTL during the test. The behaviour under test (join +
prefetch + cache serve) is unaffected.

Co-authored-by: Krrish Dholakia <krrish-berri-2@users.noreply.github.com>
2026-09-13 21:20:17 +00:00
..
auth test(auth): isolate prefetch assertions from cache expiry 2026-09-13 21:20:17 +00:00
management feat(team): report per-user spend within a team for JWT traffic (#39771) 2026-09-04 12:00:47 -07:00
spend fix(proxy): attribute gate-rejected requests to their endpoint in cache analytics (#40824) 2026-09-12 16:03:38 -07:00
__init__.py feat(tests): behavior-pinning harness + Key Tier-1 matrix (#28321) 2026-05-20 19:27:44 -07:00