litellm/tests/test_litellm/proxy/db
devin-ai-integration[bot] 56045503db
fix(proxy): bound tool and guardrail index create_many by the spend-log statement budgets (#40561)
* fix(proxy): bound tool and guardrail index create_many by the spend-log statement budgets

One flush drains up to MAX_LOGS_PER_INTERVAL source transactions or logs, but a
transaction fans out to one LiteLLM_SpendLogToolIndex row per tool and a log
to one LiteLLM_SpendLogGuardrailIndex row per guardrail, so the index
create_many payload was unbounded. Both index writes now go through
spend_log_write_batches(SPEND_LOG_WRITE_BATCH_MAX_BYTES, SPEND_LOG_WRITE_BATCH_MAX_ROWS).
The tool index write moves out of the rollup batch_() so the split reduces
the query-engine payload; replayed index rows are no-ops under
skip_duplicates, and the daily rollup upserts stay in one transaction

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(proxy): pin the row budget in the index fan-out tests

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: yucheng <yucheng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-12 19:00:47 -07:00
..
db_transaction_queue fix(caching): let only the recovery probe close a half-open Redis breaker 2026-09-10 18:36:19 -07:00
mcp_server
conftest.py test: count a zombie grandchild as killed in the fake prisma cli 2026-09-09 10:01:22 +00:00
test_autorouter_session_rollup.py feat(auto-router): show routed model and savings in Claude Code and Codex (#40330) 2026-09-11 12:52:42 -07:00
test_budget_window_spend_writer.py fix(proxy): keep persisted spend another pod has not incremented in the window seed 2026-08-31 15:49:03 -07:00
test_check_migration.py fix(proxy): kill the whole prisma process group when a boot migration command times out (#39509) 2026-09-08 10:06:53 -07:00
test_create_views.py
test_daily_spend_bulk_upsert.py
test_db_spend_update_writer.py Merge pull request #39556 from BerriAI/litellm_fix_spend_log_flush_event_loop_binding 2026-09-08 15:59:11 -07:00
test_db_url_settings.py fix(db): carry DATABASE_SSLMODE/DATABASE_SSLROOTCERT into the assembled writer and reader URLs (#40815) 2026-09-12 02:14:39 +00:00
test_exception_handler.py fix(proxy): recreate the Prisma client when the writer session turns read-only (#40610) 2026-09-10 13:53:42 -07:00
test_exception_handler_reconnect_retry.py
test_gateway_request_tracking.py perf(proxy): collapse per-worker SGR upserts into one statement per flush (#40362) 2026-09-09 10:48:06 -07:00
test_health_check_latest.py fix(proxy): dedup latest health checks in SQL and gate the DB save per window 2026-09-03 11:33:44 +02:00
test_model_access_group_spend.py
test_pgbouncer.py test(pgbouncer): stop the never-listens replacement test flaking under CI load (#40830) 2026-09-11 19:32:56 -07:00
test_prisma_client.py fix(db): carry DATABASE_SSLMODE/DATABASE_SSLROOTCERT into the assembled writer and reader URLs (#40815) 2026-09-12 02:14:39 +00:00
test_prisma_planned_engine_restart.py
test_prisma_self_heal.py fix(proxy): recreate the Prisma client when the writer session turns read-only (#40610) 2026-09-10 13:53:42 -07:00
test_proxy_worker_heartbeat.py
test_query_engine_reaper.py test(proxy): isolate reaper state and reap Prisma fixture children 2026-09-08 17:35:43 -07:00
test_rds_iam_token_expiry.py
test_replica_identity.py fix(proxy-extras): kill the whole Prisma process group when a command times out 2026-09-02 18:29:55 -07:00
test_routing_prisma_wrapper.py fix(db): carry DATABASE_SSLMODE/DATABASE_SSLROOTCERT into the assembled writer and reader URLs (#40815) 2026-09-12 02:14:39 +00:00
test_shadow_eval_funnel.py
test_spend_counter_reseed.py perf(proxy): one MGET and one pipeline for post-call spend counters, no team/user/org refetch on the response path (#40841) 2026-09-12 16:05:50 +00:00
test_spend_log_batching.py
test_spend_log_tool_index.py fix(proxy): bound tool and guardrail index create_many by the spend-log statement budgets (#40561) 2026-09-12 19:00:47 -07:00
test_token_auth.py
test_tool_registry_writer.py