litellm/tests/integration/database
Kerry Lu db75214bdc
fix(proxy): keep a customer budget reset from being undone by a stale hierarchy cache entry (#51694)
* fix(proxy): keep a customer budget reset from being undone by a stale hierarchy cache entry

The reset job now evicts the customer_org_alias entries of the organizations it resets, and a
hierarchy load that began before an eviction can no longer cache what it read. The cache hands
a lease out on a miss and refuses the write when the key was evicted since, on this worker and,
with enable_redis_auth_cache, on any worker through a generation key checked in Redis.

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

* fix(proxy): drop auth cache memory before the generation write and skip an empty alias eviction

delete cleared memory only after its new Redis round trip, so a deleted entry stayed readable on
the handling worker while Redis was slow. The reset job also broadcast an empty alias eviction for
a cascade with no customer organizations.

* fix(proxy): delete an auth cache entry and void its leases in one script on the bulk path too

The bulk delete wrote the generation and sent the DEL as two round trips, so a failed generation
write still let the DEL run and an in-flight load could re-cache what it read.

* fix(proxy): delete the auth cache entry before the generation write inside the script

A Redis at its memory limit with noeviction refused the script at its leading SET, so the DEL
never ran and a deleted entry stayed in Redis. With the DEL first the script still deletes it.

* test(proxy): mark the new reset cache tests' bindings Final and use rstest for the new Rust test

* fix(proxy): refuse a leased auth cache write for a key no generation key can guard

* test(proxy): undo the unrelated reformat of the spend ledger parity tests

* test(redis-store): mark the updated memory-only auth cache test with rstest

* chore(proxy): drop two pointer comments from the cache lease code

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-13 14:21:20 -08:00
..
image test(image): point admin MCP schema push at /app/litellm/schema.prisma (#51446) 2026-11-12 16:18:01 -08:00
migrations test(integration): point database tests at the moved litellm/proxy-extras package (#51453) 2026-11-12 20:27:00 +00:00
test_alerts.py feat(alerts): add management controls and opt-in daily summaries (#51418) 2026-11-12 10:06:07 -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_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_migration_entrypoint.py chore: move workspace packages under litellm (#51000) 2026-11-12 04:19:57 +00:00
test_partition_transactions.py test: fix stale and flaky tests across CircleCI, GHA and Buildkite (#45530) 2026-10-09 11:40:14 -07:00
test_performance_alerts.py fix(alerts): stop detecting traffic drops (#51338) 2026-11-11 20:22:24 -08:00
test_prisma_engine_port.py fix(proxy): let the OS assign Prisma engine ports (#50850) 2026-11-10 07:28:55 +00: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 test(integration): point database tests at the moved litellm/proxy-extras package (#51453) 2026-11-12 20:27:00 +00:00
test_proxy_database_lifespan.py test(integration): point database tests at the moved litellm/proxy-extras package (#51453) 2026-11-12 20:27:00 +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 test(integration): point database tests at the moved litellm/proxy-extras package (#51453) 2026-11-12 20:27:00 +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 chore: move workspace packages under litellm (#51000) 2026-11-12 04:19:57 +00:00
test_spendlogs_ledger_parity.py fix(proxy): keep a customer budget reset from being undone by a stale hierarchy cache entry (#51694) 2026-11-13 14:21:20 -08: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