litellm/tests/test_litellm/proxy/db/db_transaction_queue
ryan-crabbe-berri 5eff708d0f fix(proxy): keep persisted spend another pod has not incremented in the window seed
The batch start told the seed which LiteLLM_SpendLogs rows were its own, but
using it as a hard cutoff also dropped rows another pod had already persisted.
Those rows are only repaid by that pod's own increment, so if it died first the
window row stayed permanently under the recorded spend.

The seed now reads both sums in one scan and takes off this batch's own spend,
flooring at the pre-batch total for the case where its log rows have not landed
yet. Redis payloads keep an empty request_ids so a leader from before the field
was dropped can still merge what it pops during a rolling deploy.

Claude-Session: https://claude.ai/code/session_01QvQzYztinxj8ZuD5YxbVdL
2026-08-31 15:49:03 -07:00
..
test_base_update_queue.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_daily_spend_update_queue.py feat(spend): report prompt caching savings as total and gateway-attributed (#38134) 2026-08-28 00:19:06 -07:00
test_pod_lock_manager.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_redis_update_buffer.py fix(proxy): keep persisted spend another pod has not incremented in the window seed 2026-08-31 15:49:03 -07:00
test_spend_logs_partition_manager.py test: require a match= on broad pytest.raises, and drop duplicate parametrize cases (#37769) 2026-08-20 20:24:49 -07:00
test_spend_update_queue.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_tool_discovery_queue.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_window_spend_update_queue.py refactor(proxy): bound the budget window seed by time instead of request ids 2026-08-29 17:13:26 -07:00