test(auth): preload proxy app so prefetch test outlives the org cache TTL

The prefetch caches the org row for DEFAULT_IN_MEMORY_TTL (5s), and the first getter the
test calls goes through log_db_metrics, which lazily imports proxy_server. On CI that import
takes around 5s, so the org entry expires before get_org_object reads it and the lookup falls
through to the mocked DB. Loading proxy_server with the test module moves that cost ahead of
the prefetch
This commit is contained in:
Harshit1259 2026-09-13 13:59:14 +05:30
parent 82a73cd699
commit b5635e1a8f

View file

@ -8,6 +8,7 @@ from uuid import uuid4
import pytest
import litellm.proxy.proxy_server # noqa: F401 # preload log_db_metrics' lazy import; it can outlast the 5s org TTL
from litellm.caching.in_memory_cache import InMemoryCache
from litellm.proxy.auth.auth_checks import (
get_org_object,