From f434cdbdcee7b2f279407a2be2d06a3acc6b683c Mon Sep 17 00:00:00 2001 From: yuneng-jiang Date: Mon, 16 Mar 2026 00:20:40 -0700 Subject: [PATCH] [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 --- tests/llm_translation/conftest.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/llm_translation/conftest.py b/tests/llm_translation/conftest.py index e258bafc01..8388e7bb10 100644 --- a/tests/llm_translation/conftest.py +++ b/tests/llm_translation/conftest.py @@ -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)