Merge pull request #50849 from BerriAI/litellm_rc109_beta_header_test_bundled_config

test: repair four failing tests on rc/1.109.0
This commit is contained in:
yuneng-jiang 2026-11-10 00:34:14 -08:00 • committed by GitHub
commit 55c9c6af17
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 3 deletions

View file

@ -1227,6 +1227,7 @@ def test_modern_subscription_delivers_changes_between_calls_and_refreshes_tools(
"PYTHONPATH": os.pathsep.join((str(source), str(source / "tests"))),
"LITELLM_SALT_KEY": "subscription-pagination-key",
**({"LITELLM_MCP_TOOL_LISTING_TIMEOUT": "2"} if access == "probe-timeout" else {}),
**({"LITELLM_MCP_METADATA_TIMEOUT": "5"} if access == "mixed-capabilities" else {}),
"STORE_MODEL_IN_DB": "False",
"DISABLE_SCHEMA_UPDATE": "true",
"LITELLM_LOCAL_MODEL_COST_MAP": "True",

View file

@ -222,6 +222,7 @@ async def test_tier_pin_joins_pending_reads_without_reusing_request_state(mode:
)
client: Final = Redis(connection_pool=pool)
client_key: Final = redis._get_async_client_cache_key()
litellm.in_memory_llm_clients_cache.flush_cache()
litellm.in_memory_llm_clients_cache.set_cache(key=client_key, value=client)
cache: Final = DualCache(redis_cache=redis)
key: Final = redis.check_and_fix_namespace("pin")

View file

@ -358,16 +358,17 @@ def _burst(
*,
rejected_model: str = CRAFTED_MODEL,
) -> tuple[_BurstResult, ...]:
nonce: Final = uuid.uuid4().hex
crafted: Final = tuple(
(f"crafted-{path}-{index}", path, _body(path, rejected_model, uuid.uuid4().hex, stream=index % 2 == 1), open_key)
for path in (CHAT, MESSAGES, RESPONSES)
for index in range(4)
)
happy: Final = tuple(
(f"happy-{index}", CHAT, _body(CHAT, happy_model, f"happy-{index}"), happy_key) for index in range(8)
(f"happy-{index}", CHAT, _body(CHAT, happy_model, f"happy-{index}-{nonce}"), happy_key) for index in range(8)
)
late: Final = tuple(
(f"late-{index}", CHAT, _body(CHAT, happy_model, f"late-{index}"), happy_key) for index in range(8)
(f"late-{index}", CHAT, _body(CHAT, happy_model, f"late-{index}-{nonce}"), happy_key) for index in range(8)
)
with (
ThreadPoolExecutor(max_workers=28) as pool,
@ -427,6 +428,7 @@ def test_killing_one_worker_mid_burst_leaves_the_other_serving_crafted_and_happy
open_key: Final = scenario.key()
control: Final = _burst(client, model, key, open_key, lambda: None, rejected_model=BENIGN_288KB_MODEL)
assert all(result.status == (400 if result.label.startswith("crafted") else 200) for result in control), control
wire.drain()
workers: Final = owned.worker_pids()
assert len(workers) == 2, workers
victim: Final = min(workers)
@ -438,6 +440,8 @@ def test_killing_one_worker_mid_burst_leaves_the_other_serving_crafted_and_happy
_assert_burst_rejections_fast(results, control)
late: Final = tuple(result for result in results if result.label.startswith("late"))
assert all(result.status == 200 for result in late), late
seen: Final = tuple(request.body.decode() for request in wire.drain())
assert all(any(f"normalized error audit {result.label}-" in body for body in seen) for result in late), seen
_assert_rows_land_exactly_once(results, "late")
survivor: Final = tuple(pid for pid in owned.worker_pids() if pid != victim)
assert survivor, "no worker left serving"

View file

@ -640,7 +640,7 @@ async def test_vertex_ai_anthropic_prompt_caching_does_not_add_beta_header(
assert "anthropic_beta" not in json.loads(request.content)
def test_vertex_ai_partner_models_anthropic_remove_prompt_caching_scope_beta_header():
def test_vertex_ai_partner_models_anthropic_remove_prompt_caching_scope_beta_header(local_beta_headers_config: None) -> None:
"""
Test that remove_unsupported_beta correctly filters out prompt-caching-scope-2026-01-05
from the anthropic-beta headers.