You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In codespace terminal install dev dependencies e.g. uv sync --frozen --all-extras --dev
In codespace terminal run uv run pytest -vv
In codespace terminal check tests completed
Repeat 5 until test hangs (usually within 1-5 repeats but I have seen up to 10 successes prior to a hang)
Expected behavior
Tests run to completion and do not hang
Screenshots
Desktop (please complete the following information):
OS: Github codeworkspace
Browser Firefox
Version main
Additional context
As can be seen from the screen shot their appears to be a port open, I suspect a race condition meaning the test some times gets stuck, I've not yet had a chance to figure out what the test is doing
Activity
davemssavage commentedon May 18, 2025
doing some checks with print statements indicates the hang is here:
https://github.com/modelcontextprotocol/python-sdk/blob/main/tests/shared/test_streamable_http.py#L1126
then
https://github.com/modelcontextprotocol/python-sdk/blob/main/src/mcp/shared/session.py#L280
On the receiving side it seems to get to here:
https://github.com/modelcontextprotocol/python-sdk/blob/main/src/mcp/client/streamable_http.py#L232
Which just blocks waiting for event_source.aiter_sse() to yield an sse event but nothing arrives
This may be a simple deadlock where each side is waiting for the other to send a message
davemssavage commentedon May 18, 2025
Noting also that this might be a known issue on the httpx-sse library:
florimondmanca/httpx-sse#4
Further digging and encode/httpx#2186 (comment) seems to suggest a hacky fix
davemssavage commentedon Jul 11, 2025
I've not observed this in a while and the tests have been updated so closing this assuming it has been fixed