litellm/tests/unit/llms/custom_httpx
ryan-crabbe-berri b0f408e64e
fix(aiohttp_transport): close sessions of evicted Azure and base64 embedding clients (#52266)
* test(caching): cover unclosed sessions from evicted azure and base64 embedding clients

* fix(aiohttp_transport): keep the owned session out of a collected transport's garbage cycle

An evicted OpenAI SDK client that became a reference cycle was freed by the
cycle collector together with its transport, aiohttp session and connector.
The transport's __del__ could only schedule an async close, so aiohttp's own
finalizers reported the session and connector as unclosed.

The transport now registers a weakref.finalize for the session it owns. The
finalizer registry keeps the session out of the cyclic garbage and disposes
it with the existing loop-aware close once the transport is freed.

* fix(aiohttp_transport): type the session finalizer and cover the factory-built session path
2026-11-17 17:16:41 -08:00
..
__init__.py test: move tests/test_litellm/llms into tests/unit/llms (#43191) 2026-09-25 12:43:23 -07:00
test_aiohttp_cleanup_closed.py refactor(llms): expose public names for private provider helpers (#45037) 2026-10-07 08:49:25 -07:00
test_aiohttp_handler.py fix(http): diagnose aiohttp connection pool saturation (#49499) 2026-10-31 16:12:30 -07:00
test_aiohttp_so_keepalive.py refactor(llms): expose public names for private provider helpers (#45037) 2026-10-07 08:49:25 -07:00
test_aiohttp_transport.py fix(aiohttp_transport): close sessions of evicted Azure and base64 embedding clients (#52266) 2026-11-17 17:16:41 -08:00
test_asgi_handler.py test: move tests/test_litellm/llms into tests/unit/llms (#43191) 2026-09-25 12:43:23 -07:00
test_async_client_cleanup.py test: move 76 live top-level tests to offline unit and integration coverage (#45352) 2026-10-08 10:33:35 -07:00
test_container_handler.py test: catch regressions in the validation lines #44798 added (#47420) 2026-10-20 01:06:37 +00:00
test_credential_leak_prevention.py test: move tests/test_litellm/llms into tests/unit/llms (#43191) 2026-09-25 12:43:23 -07:00
test_gemini_session_leak.py test(unit): stop test modules from putting their own directory on sys.path (#43421) 2026-09-28 12:20:20 -07:00
test_http2_connection_spread.py feat(vertex_ai)!: use HTTP/2 httpx client for search_api vector store (#40631) 2026-10-29 10:31:18 -07:00
test_http_handler.py feat(proxy)!: require a LITELLM_SALT_KEY of at least 112 bits to start in fips_mode (#52099) 2026-11-17 12:58:59 -08:00
test_llm_http_handler.py fix(responses): prevent duplicate authorization headers (#52259) 2026-11-18 01:15:52 +00:00
test_mock_transport.py test: move tests/test_litellm/llms into tests/unit/llms (#43191) 2026-09-25 12:43:23 -07:00
test_sse_lines.py fix(streaming): keep merged think tags balanced and split SSE lines only on CR/LF (#48755) 2026-10-28 17:00:29 -07:00