mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-06 08:16:43 +00:00
fix(e2e): poll for both spend rows before asserting the cache-hit contract (#34968)
The cache-hit and paid rows for the two driver calls flush from different pods on independent update_spend timers, so waiting only for the cache-hit row can return a half-arrived result set where the paid-row assertion then fails on an empty list. Requiring both row kinds in the poll predicate lets the existing deadline absorb the slower flush without weakening any assertion
This commit is contained in:
parent
b930e2fc2b
commit
01ffd1296b
1 changed files with 3 additions and 1 deletions
|
|
@ -230,7 +230,9 @@ def test_cache_hit_is_zero_cost_and_suffixed(
|
|||
_ = unwrap(client.chat(scoped_key, "gemini-2.5-flash", prompt, max_tokens=16))
|
||||
|
||||
rows = client.poll_logs_for_key(
|
||||
scoped_key, predicate=lambda rs: any(r.cache_hit == "True" for r in rs)
|
||||
scoped_key,
|
||||
predicate=lambda rs: any(r.cache_hit == "True" for r in rs)
|
||||
and any(r.cache_hit != "True" for r in rs),
|
||||
)
|
||||
cache_row = _require_row(
|
||||
rows,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue