mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-19 22:19:07 +00:00
* fix: reset db_health_cache in source module to prevent stale cache hits The test was reassigning db_health_cache via `global` in the test module, which doesn't affect the _health_endpoints module's variable. When a prior test set the cache to "connected" within 2 minutes, _db_health_readiness_check returned early without calling health_check(), causing assert_called_once to fail. Also use PrismaError with a connection message so it's properly recognized as a connection error by PrismaDBExceptionHandler.is_database_connection_error. * fix: replace asyncio.sleep with polling loop in spend logs tests The GLOBAL_LOGGING_WORKER processes callbacks via an async queue, so asyncio.sleep(1) is a race condition - under CI load the worker may not have processed the queued task within 1 second. Replace with a polling helper that waits up to 10 seconds for the mock to be called. Also add metadata.attempted_retries and metadata.max_retries to ignored_keys since these are new fields. * fix: isolate test_skip_server_startup from CI environment Remove mix_stderr=False (unsupported in some Click versions). Strip DATABASE_URL/DIRECT_URL from environment during the test to prevent real prisma operations when these are set in CI.