litellm/tests/unit/proxy/db
paveln83 b4918c9a05
fix(proxy): start and serve the proxy with a database on Python 3.10 and prisma 0.13+ (#54416)
* fix(proxy): start the Prisma engine on Python 3.10 and pin prisma to the versions it supports

The port-owning query engine waited with asyncio.timeout, which only exists on Python 3.11+, so a proxy with a database could not start on 3.10. It now waits with asyncio.wait_for

The engine subclass imports prisma.builder, which prisma 0.13 removed, so extra_proxy now allows prisma>=0.11.0,<0.13. prisma 0.12.0 passes the engine tests on 3.10

A fake query engine executable covers the connect, silent, and early-exit paths, and a new prisma-engine-python-310 CI shard runs those tests on Python 3.10 whenever the engine code changes

* fix(proxy): run the Prisma engine on prisma 0.13+ and fix Python 3.10 chat with a database

Drop the prisma<0.13 cap and make the engine subclass work on prisma 0.11 through 0.15. OVERWRITE_DATASOURCES is built with json.dumps instead of the removed prisma.builder, and the client's HTTP options reach the engine as http_config when its constructor takes it

Build CallContext without the subscripted alias, which raised TypeError on Python 3.10 for every chat call with a database

Move the engine tests that start a real process to tests/integration/database, and have the Python 3.10 CI shard install prisma 0.15.0 and run the dispatcher tests too

* fix(proxy): set the Prisma client engine through its setter so prisma 0.15 connects

* test(proxy): run the query engine spawn path in-process on Python 3.10

* fix(proxy): keep TimeoutError as the cause of the query engine connect timeout

The connect timeout EngineConnectionError chains the TimeoutError again, as on the merge base, so the startup traceback keeps its direct cause block

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-26 00:09:17 +00:00
..
db_transaction_queue fix(proxy): avoid blocking writes when attaching spend log partitions (#53858) 2026-11-23 11:19:33 -08:00
mcp_server
__init__.py
conftest.py
fake_prisma_engine.py
test_autorouter_session_rollup.py
test_budget_window_spend_writer.py fix(proxy): preserve budget window edits during resets (#53064) 2026-11-20 10:50:27 -08:00
test_check_migration.py fix(proxy): point the startup schema drift check at the packaged schema.prisma (#52435) 2026-11-19 17:49:06 -08:00
test_connection_budget.py feat(spend-logs): rust spend log callback (#52182) 2026-11-20 16:31:04 -08:00
test_create_views.py
test_daily_spend_bulk_upsert.py feat(proxy): add app groups with shared budgets and usage (#53232) 2026-11-21 12:50:58 -08:00
test_db_lookup_gate.py
test_db_span.py
test_db_spend_update_writer.py fix(proxy): stop requeueing rejected tool discovery batches to Redis (#53886) 2026-11-23 11:57:09 -08:00
test_db_url_settings.py
test_exception_handler.py
test_exception_handler_reconnect_retry.py
test_gateway_request_tracking.py
test_health_check_latest.py
test_log_db_metrics.py
test_log_db_metrics_service_spans.py
test_master_key_migration.py fix(proxy): rotate all database secrets with the master key (#52998) 2026-11-20 10:02:59 -08:00
test_model_access_group_spend.py
test_model_insights_tasks.py
test_model_usage_rollup.py
test_native_database.py
test_object_permission_repository.py
test_pgbouncer.py
test_prisma_client.py
test_prisma_engine.py fix(proxy): start and serve the proxy with a database on Python 3.10 and prisma 0.13+ (#54416) 2026-11-26 00:09:17 +00:00
test_prisma_planned_engine_restart.py fix(proxy): start and serve the proxy with a database on Python 3.10 and prisma 0.13+ (#54416) 2026-11-26 00:09:17 +00:00
test_prisma_query_span.py
test_prisma_self_heal.py
test_proxy_worker_heartbeat.py
test_query_engine_reaper.py
test_rds_iam_token_expiry.py
test_replica_identity.py
test_request_error_tracking.py
test_routing_prisma_wrapper.py
test_rust_spend_log_writer.py feat(spend-logs): rust spend log ledger writer (#52163) 2026-11-20 16:31:04 -08:00
test_scheduled_job_runs.py
test_shadow_eval_funnel.py
test_spend_counter_reseed.py
test_spend_log_batching.py
test_spend_log_tool_index.py fix(proxy): stop requeueing rejected tool discovery batches to Redis (#53886) 2026-11-23 11:57:09 -08:00
test_token_auth.py
test_tool_registry_writer.py fix(proxy): stop requeueing rejected tool discovery batches to Redis (#53886) 2026-11-23 11:57:09 -08:00
test_tool_table_bulk_upsert.py
test_update_daily_tag_spend.py