litellm/tests/test_litellm/proxy/management_helpers
yassin 264305de23 fix(proxy): keep access-group raw SQL writes on the writer while writer_unavailable is stale
A stale RoutingPrismaWrapper.writer_unavailable flag made WriterPinnedClient hand back the routed wrapper, where query_raw is classified as a read, so the access-group UPDATE statements behind /key/regenerate, /key/generate with access_group_ids and model rename/delete went to the read replica and failed with SQLSTATE 25006. Route those raw statements through the underlying writer regardless of the flag; a raw SQL write has no replica fallback. WriterPinnedClient keeps yielding to the replica for degraded reads.

The model sync's backing-row count stays on the writer too: it runs right after the row delete/update on the writer and a lagging replica could still report the removed row, which would leave the group naming a model nobody serves.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 19:55:07 +00:00
..
team_metadata_validator_impls.py feat(team): custom metadata validation hook for team create and update (#33353) 2026-08-03 18:37:45 -07:00
test_access_group_key_sync.py fix(proxy): keep access-group raw SQL writes on the writer while writer_unavailable is stale 2026-09-15 19:55:07 +00:00
test_access_group_model_sync.py fix(proxy): keep access-group raw SQL writes on the writer while writer_unavailable is stale 2026-09-15 19:55:07 +00:00
test_access_group_team_sync.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_audit_log_callbacks.py test(audit-logs): let monkeypatch own the audit log and s3 callback globals (#37842) 2026-08-21 20:16:10 -07:00
test_auto_router_permissions.py feat(auto-router): allow opted-in team members to manage their routers 2026-09-14 23:56:55 -07:00
test_bulk_user_creation.py refactor(proxy): move bulk user creation to POST /management/v1/users/bulk 2026-09-14 22:28:39 +00:00
test_bulk_user_deletion.py fix(proxy): only widen an id-only bulk member delete to its email when the user lists the team 2026-09-15 00:09:57 +00:00
test_management_helpers_utils.py fix(team): serialize member_add, member_delete, and delete under the team's advisory lock (#37969) 2026-08-25 21:55:11 +00:00
test_object_permission_utils.py feat(proxy): granular key/team access control for Claude Code marketplace plugins (#40518) 2026-09-10 14:26:09 -07:00
test_resource_display_names.py feat(access-groups): resolve resource names on access group responses 2026-09-04 16:08:50 -07:00
test_team_member_permission_checks.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_team_metadata_validation.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00