mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-13 16:23:06 +00:00
[Fix] Remove flush_cache from llm_translation conftest to prevent connection churn
The old conftest never flushed HTTP client cache. Adding flush_cache() before every test forces new TCP connections to external APIs, causing transient connection failures under xdist parallelism. Global state isolation is already handled by _SCALAR_DEFAULTS reset. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
acfaea9d25
commit
f434cdbdce
@@ -93,18 +93,12 @@ def setup_and_teardown(event_loop): # Add event_loop as a dependency
|
||||
if hasattr(litellm, attr):
|
||||
setattr(litellm, attr, default_val)
|
||||
|
||||
if hasattr(litellm, "in_memory_llm_clients_cache"):
|
||||
litellm.in_memory_llm_clients_cache.flush_cache()
|
||||
|
||||
# Set the event loop from the fixture
|
||||
asyncio.set_event_loop(event_loop)
|
||||
|
||||
yield
|
||||
|
||||
# ---- Teardown ----
|
||||
if hasattr(litellm, "in_memory_llm_clients_cache"):
|
||||
litellm.in_memory_llm_clients_cache.flush_cache()
|
||||
|
||||
for attr, original_value in original_state.items():
|
||||
if hasattr(litellm, attr):
|
||||
setattr(litellm, attr, original_value)
|
||||
|
||||
Reference in New Issue
Block a user