Repository navigation
test(ci): pin the xai reported-cost split and the coordinator-held Prisma lock wait - #46645
Conversation
…k timeout Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Automatic reviews are disabled for this repository. |
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
@litereview code-review |
✅ code-review5/5 · Ready for human reviewScope: full · Full PR review. Completed · Some checks not run. No correctness findings. Checks and execution details
View review · Reviewed |
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 16d30fd. Configure here.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@litellm-stampbot |
litellm-stampbot: risk lowApproved at Rules (
Judge (gpt-6-luna): low, probability of high 0.00 (high at or above 0.90)
Pushes do not re-run this check. Comment |
kerry-berri
left a comment
There was a problem hiding this comment.
Low risk by rule and by judgement at 16d30fd
TLDR
Problem this solves:
integration-costandmigration-startupare red on every scheduledmainrun since 2026-10-15 00:09 UTCHow it solves it:
Relevant issues
Red on
mainin integration pipeline 91253 job integration-cost 2260303, and in migration pipeline 91252 job migration-startup 2260279. Both have failed in every scheduled run since the culprits landed (integration 91241 through 91253, migration 91243 and 91252), and passed in the runs before (integration 91235 did not fail this case, migration 91236 green)tests/integration/cost_calculation/test_cost_tracking.py::test_case_bills_expected_cost[xai-grok-5-provider_reported_cost]fails withinput_cost 0.029078078078078076 != expected 0.0. The culprit is 44e94eb (#46320), which on purpose splits xAI's reported total across input and output in the ratio our token math gives. That PR moved the cases incases/xai.pybut missed the grok-5 case incases/misc.py. The new expected split is 1840 prompt tokens at 1.35e-6 and 412 completion tokens at 2.7e-6 applied to the reported 0.0421, so input 0.029078078 and output 0.013021922, with spend unchangedtests/e2e/migrations/test_startup.py::TestMigrationStartup::test_lock_deadline_then_restartfails withTimed out waiting for Prisma lock contention. The culprit is 2310dae (#46368), which disables Prisma's session advisory lock and has the proxy hold the coordinator key, then poll Prisma's key 72707369 withpg_try_advisory_xact_lock. A polling waiter never shows up as an ungrantedpg_locksrow, so the oldblocked(PRISMA_LOCK)probe can never fire. The test now waits for a replica to hold the coordinator lock while the test holds Prisma's key, and requires the replica to fail with the specificTimed out waiting for Prisma's lockmessage, so it still proves the replica reached Prisma's key and gave up at the deadline without touching historyDeferred to their own fixes.
test_bad_database_urlandtest_v2_resolver_unreachable_database_exits_2_and_names_p1001(integration-database,integration-database-replica) are covered by #46592.test_request_log_indexes::test_a_migration_job_that_could_not_build_the_indexes_reports_failure_and_succeeds_when_rerun[v2]times out because #46368 now takes the coordinator key around everyprisma migrate deploy, the same key a running index build holds, so a v2 boot waits behind any index build. Picking which side gets its own key is a design call left to the #46368 author. Theintegration-providersreds (tool-search replay, thinking history, prompt cache pin TTL, bridged invalid prompt fallback) and theintegration-extensionsPrometheus shared-label reds have several unrelated causes and were not bisected in this runPre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or moreScreenshots / Proof of Fix
This is a test-only change, so the proof is the previously red CircleCI jobs on this branch
Before (ea777eb)
integration-costfailed on the grok-5 casemigration-startupfailed ontest_lock_deadline_then_restartAfter (16d30fd)
test_lock_deadline_then_restartpassing in migration-startup 2260381integration-browserhit asocket hang upon/team/deletecleanup and passed on rerun (job 2260413).integration-providers,integration-extensions,integration-database,integration-database-replicaandtest_bad_database_urlstay red here exactly as onmain, deferred as described aboveType
✅ Test
QA runbook
SELECT pg_advisory_lock(72707369)on the proxy's database--use_v2_migration_resolverandLITELLM_MIGRATION_LOCK_TIMEOUT=12SELECT pid FROM pg_locks WHERE locktype='advisory' AND grantedshows the proxy holding thellm_mig2coordinator keyTimed out waiting for Prisma's lockand_prisma_migrationsunchangedFinal Attestation
Link to Devin session: https://app.devin.ai/sessions/5c13f40005934ef0a488261a6e88253a
Open in Devin Desktop: https://app.devin.ai/desktop/session/5c13f40005934ef0a488261a6e88253a?variant=devin
Requested by: @mateo-berri
Note
Low Risk
Changes are limited to test expectations and e2e lock observability; no production code paths are modified.
Overview
Test-only updates so CI matches intentional product changes that landed on
mainwithout updating every assertion.The xai/grok-5 provider-reported cost integration case now expects input and output cost split (≈0.029078078 / ≈0.013021922) while total spend stays 0.0421, aligning
misc.pywith the xAI reported-cost allocation behavior introduced elsewhere.For migration startup, e2e helpers gain
Database.holders()(granted advisory locks).test_lock_deadline_then_restartwaits for a replica to holdCOORDINATOR_LOCKwhile the test holds Prisma’s lock, then asserts exit withTimed out waiting for Prisma's lock—replacing ablocked(PRISMA_LOCK)probe that no longer fires when Prisma waits viapg_try_advisory_xact_lockpolling.Reviewed by Cursor Bugbot for commit 16d30fd. Bugbot is set up for automated code reviews on this repo. Configure here.