Repository navigation
fix(ci): restore loadscope on the mcp-interactions shard so its MCP subscription cases do not race across workers - #46783
Conversation
…ubscription cases do not race across workers Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Automatic reviews are disabled for this repository. |
|
@litereview code-review |
|
bugbot run |
✅ code-review5/5 · Ready for human reviewScope: full · Full PR review. Completed · Some checks not run. No correctness findings. The one-line change puts Checks and execution details
View review · Reviewed |
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 878528e. 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 878528e
TLDR
Problem this solves:
mcp-interactionsshard is red on main at bb26e6d, merge of fix(ci): run the MCP interactions integration contract in its own unit shard #46773How it solves it:
mcp-interactionsback todist: loadscope, the setting fix(ci): run the MCP interactions integration contract in its own unit shard #46773 was proven green withUser Flow
Before: every push to main gets a red
mcp-interactionscheck from a race between test casesmcp-interactionsshard1 failed, 43 passedon the first attempt and2 failed, 42 passedon the rerunAfter: the same push runs those cases on one worker and the check goes green
mcp-interactionsshardmcp-elicitationbefore44 passedinside the 20 minute step budgetWhy it broke
#46770 (
litellm_mcp_elicitation_shard_dist) and #46773 both fixed themcp-elicitationtimeout, and landed 4 minutes apart. #46770 changed that entry'sdist: loadscopetodist: load. #46773 splittests/integration/mcp/test_interactions.pyinto a newmcp-interactionsentry right below it. The squash merge of #46773 kept #46770'sdist: loadline, but it now sits undermcp-interactions, somcp-elicitationis back onloadscopeand the integration module is onloadWith
load, the 44 cases ran 10 to 12 per worker. The failing ids weretest_modern_subscription_delivers_changes_between_calls_and_refreshes_tools[tools-legacy-both], then[prompts-legacy-both]and[resources-legacy]on the rerun. Each failed on the upstream MCP server double logginganyio.ClosedResourceErrorthenRuntimeError: Unexpected ASGI message 'http.response.start' sent, after response already completed. The same race showed up locally when these cases ran with--dist loadwhile #46773 was being written, which is why #46773 keptloadscope. In #46773's own CI the shard ran all 44 cases on one worker and passedmcp-elicitationis green on main at bb26e6d (job 116712254761), so this PR touches only themcp-interactionsentryScreenshots / Proof of Fix
The proof is this PR's own CI at the tip, against the red main runs linked in the TLDR
dist: load)dist: loadscope)mcp-interactions1 failed, 43 passed in 479.68s, rerun2 failed, 42 passed in 457.28s, cases spread over gw0 to gw344 passed in 1058.34s, all 44 on gw0, step took 17m 47smcp-elicitation2731 passed in 522.33sThe diff only touches
.github/workflows/test-unit.yml, so no proxy code path changes and there is nothing to curl. All 87 checks are green at the tipType
🚄 Infrastructure
✅ Test
Pre-Submission checklist
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 moreCaveats (if any)
Medium
legacysubscription cases is still latentdist: loadFinal Attestation
The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR
878528e passes /live-pr-risk
Link to Devin session: https://app.devin.ai/sessions/db431364252141718b3b09064477ee4d
Open in Devin Desktop: https://app.devin.ai/desktop/session/db431364252141718b3b09064477ee4d?variant=devin
Requested by: @mateo-berri
Note
Low Risk
Workflow-only change to pytest parallelization; no runtime or application code is modified.
Overview
Restores
loadscopepytest-xdist distribution on themcp-interactionsunit-test shard in.github/workflows/test-unit.yml, replacingload.That shard runs
tests/integration/mcp/test_interactions.pywith four workers. Underload, subscription integration cases were split across workers and could run several MCP proxies at once, causing flaky ASGI/ClosedResourceErrorfailures on main.loadscopekeeps each test module on a single worker so those cases run serially within the module, matching how the shard was green before a merge accidentally leftloadon this entry.Reviewed by Cursor Bugbot for commit 878528e. Bugbot is set up for automated code reviews on this repo. Configure here.