From b5635e1a8fef03a58fa503a8bf68479f73369876 Mon Sep 17 00:00:00 2001 From: Harshit1259 Date: Sun, 13 Sep 2026 13:59:14 +0530 Subject: [PATCH] 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 --- tests/proxy_behavior/auth/test_auth_object_prefetch.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/proxy_behavior/auth/test_auth_object_prefetch.py b/tests/proxy_behavior/auth/test_auth_object_prefetch.py index e2d947f4284..b90097e4b31 100644 --- a/tests/proxy_behavior/auth/test_auth_object_prefetch.py +++ b/tests/proxy_behavior/auth/test_auth_object_prefetch.py @@ -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,