mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
test(utils): pin the register_model replay test to the recorded half (#35994)
test_reapply_runtime_registrations_replays_register_model_overrides asserts that a fetched catalog value survives the replay for a key an operator override does not mention. Any Router still alive in the process re-asserts its own deployments first, so a router serving openai/gpt-4o writes its model_info over that catalog value and the assertion reads the router's number instead. Routers built by earlier tests stay in the weak set until they are collected, which made the test depend on collection timing and fail intermittently in shards that run the router tests alongside it. The live-router rebuild is covered in test_router_model_cost_isolation.py, so this test now runs with the replay callback unset and exercises the recorded registrations it is about.
This commit is contained in:
parent
7984f4fa64
commit
87dbb632b2
1 changed files with 5 additions and 0 deletions
|
|
@ -5036,6 +5036,11 @@ def test_reapply_runtime_registrations_replays_register_model_overrides(monkeypa
|
|||
"_runtime_registered_model_cost",
|
||||
dict(litellm_utils._runtime_registered_model_cost),
|
||||
)
|
||||
# Only the recorded half is under test here; the live-router rebuild is covered
|
||||
# in test_router_model_cost_isolation.py. Routers built by earlier tests in this
|
||||
# process stay in the weak set until they are collected, so leaving the callback
|
||||
# installed would make this depend on when that happens.
|
||||
monkeypatch.setattr(litellm_utils._LiveDeploymentReplay, "callback", None)
|
||||
|
||||
saved_model_cost = litellm.model_cost
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue