litellm/tests/unit/accounting
joshua-berri d2a218c2f0
fix(accounting): apply retried spend deliveries in batches (#56057)
* fix(accounting): skip busy team locks and batch spend retries

* test(accounting): preserve committed retries after a reclaim failure

* fix(accounting): limit spend contention follow-up to retry batching

* test(accounting): verify configured retry batches through the worker

* fix(accounting): stop retry fallback after losing a snapshot claim

* perf(accounting): take the team roster lock shared when applying spend

Spend writers for the same team now share the per-team advisory lock instead of
queueing on it. Roster writers still take it exclusively, so a roster change and
the spend membership check still cannot interleave. Experimental, pending
measurement on the shared verification environment.

Refs #55172

* fix(accounting): retain exclusive team locks for retry batching

---------

Co-authored-by: Joshua Valluru <326636767+joshua-berri@users.noreply.github.com>
2026-12-03 12:17:41 -08:00
..
__init__.py feat(accounting): add accounting contracts, PricingSnapshot and ledger schema (LIT-10193) (#48862) 2026-10-28 14:39:25 -07:00
test_application.py feat(proxy): enforce customer org, team and member budgets and limits on the request path (#51489) 2026-11-12 20:43:44 -08:00
test_delivery_projection.py feat(proxy): add app groups with shared budgets and usage (#53232) 2026-11-21 12:50:58 -08:00
test_metrics.py fix(accounting): split a lock-timed-out spend batch by team so a held lock delays only the teams behind it (#55601) 2026-12-02 15:58:55 -08:00
test_projection.py feat(proxy): emit budget alerts for app customer scopes (#52955) 2026-11-19 16:21:09 -08:00
test_worker.py fix(accounting): apply retried spend deliveries in batches (#56057) 2026-12-03 12:17:41 -08:00