litellm/tests/integration/database
Kerry Lu 22667fb0a8
fix(proxy-extras): roll back a migration killed at the deploy time limit (#54284)
* fix(proxy-extras): roll back a migration killed at the deploy time limit

When prisma migrate deploy hits LITELLM_PRISMA_MIGRATE_DEPLOY_TIMEOUT the runner kills
Prisma, which left a started-but-unfinished ledger row and a Postgres session that
could still commit the migration later. Every later boot then stopped on P3009.

Each deploy attempt now names its Postgres sessions. After a kill the runner ends
those sessions, waits until they are gone, and marks the row the attempt left
rolled back, so the next attempt or the next boot can apply the migration again.

* fix(proxy-extras): only roll back a killed migration that is proven not to have committed

Roll the row back only when the killed deploy's session was seen still running its statement and its
open transaction is recorded as aborted after the session is ended. Measure the row's age from the
start of the deploy, and redact the database error before logging it.

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

* fix(proxy-extras): roll back every migration killed at the deploy time limit

Once the killed deploy's sessions are ended and gone, its row is rolled back without also requiring
proof that the migration had not committed.

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

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-24 23:52:42 +00:00
..
image fix(docker): disable Prisma's update check so it stops leaving zombie processes (#52642) 2026-11-18 14:38:13 -08:00
migrations fix(proxy-extras): roll back a migration killed at the deploy time limit (#54284) 2026-11-24 23:52:42 +00:00
test_alerts.py feat(alerts): add email labels, bulk actions and threshold editing (#52139) 2026-11-16 15:32:19 -08:00
test_chunked_in_lists.py ci: fail on new unbounded SQL IN lists and add a Prisma chunking helper (#42629) 2026-09-26 13:40:44 -07:00
test_cleanup_transactions.py feat(proxy): run spend log cleanup from a DB-backed scheduled job table (#50131) 2026-11-11 18:22:02 -08:00
test_control_plane_runtime_config.py feat(control_plane): fleet-wide team budgets via desired state and reconciliation (#54056) 2026-11-24 10:15:44 -08:00
test_global_spend_refresh_writer.py fix(spend): run the MonthlyGlobalSpend refresh on the writer when a read replica is configured (#45699) 2026-10-10 00:49:13 -07:00
test_harness_lifecycle.py ci: remove CircleCI (#50950) 2026-11-11 15:38:27 -08:00
test_managed_file_flat_ids_index.py test(integration): point database tests at the moved litellm/proxy-extras package (#51453) 2026-11-12 20:27:00 +00:00
test_mcp_server_events_column.py feat(mcp): persist per-server event settings (#53602) 2026-11-24 06:31:10 +00:00
test_migration_entrypoint.py fix(mcp): seed the catalog revision (#53989) 2026-11-23 22:01:53 -08:00
test_partition_transactions.py fix(proxy): avoid blocking writes when attaching spend log partitions (#53858) 2026-11-23 11:19:33 -08:00
test_performance_alerts.py test: update stale integration and e2e expectations for intended changes (#53940) 2026-11-23 14:27:20 -08:00
test_prisma_engine_port.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_prisma_migration_lock.py test(integration): fix four flaky integration tests (#49554) 2026-11-02 09:23:17 -08:00
test_proxy_boot_without_general_settings.py fix(proxy-extras): keep the host query param in the v2 migration lock URL (#52797) 2026-11-19 09:37:00 -08:00
test_proxy_database_lifespan.py fix(gateway): honor the configured Postgres connection cap (#52729) 2026-11-19 04:10:10 +00:00
test_reader_writer_regeneration.py test(integration): give each owned proxy a private database and Redis by default (#47213) 2026-10-18 03:37:41 +00:00
test_request_log_indexes_at_boot.py fix(proxy): create current and upcoming spend log partitions in the partitioning runbook (#53894) 2026-11-23 20:01:44 +00:00
test_roi_observed.py feat(roi): measure shipping velocity, quality, and recorded spend (#44426) 2026-10-03 23:07:34 +00:00
test_roi_sync_store.py feat(proxy): add native ROI calculator for gateway spend vs merged PRs (#43669) 2026-09-30 14:16:41 -07:00
test_scheduled_job_runs.py test(integration): point database tests at the moved litellm/proxy-extras package (#51453) 2026-11-12 20:27:00 +00:00
test_skill_publication.py feat(skills)!: version published Skills Hub updates (#50152) 2026-11-05 00:19:38 -08:00
test_skill_submissions.py feat(skills): let authors edit and withdraw pending submissions (#51312) 2026-11-12 08:30:10 -08:00
test_spend_lock_order.py chore: move scripts and runtime sources under litellm (#51006) 2026-11-12 04:19:57 +00:00
test_spendlogs_delivery.py fix(spend): record a failed delivery batch in one update (#53925) 2026-11-24 08:27:53 -08:00
test_spendlogs_ledger_parity.py fix(auth): report unreadable team rows as 503 and open the rust db in the spend logs parity test (#52923) 2026-11-24 19:34:37 +00:00
test_transaction_atomicity.py test(integration): add read-replica routing harness to the CircleCI integration suite (#42692) 2026-09-24 00:25:03 -07:00
test_v1_migration_error_logging.py test(integration): point database tests at the moved litellm/proxy-extras package (#51453) 2026-11-12 20:27:00 +00:00