Skip to content

Commit c3abc89

Browse files
committed
fix: use pragma lax no cover for flaky exception handler coverage
This except handler is non-deterministically covered depending on thread timing, so use lax annotation to avoid flaky CI failures.
1 parent f891016 commit c3abc89

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mcp/server/streamable_http.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ async def message_router():
10151015
try:
10161016
# Send both the message and the event ID
10171017
await self._request_streams[request_stream_id][0].send(EventMessage(message, event_id))
1018-
except (anyio.BrokenResourceError, anyio.ClosedResourceError):
1018+
except (anyio.BrokenResourceError, anyio.ClosedResourceError): # pragma: lax no cover
10191019
# Stream might be closed, remove from registry
10201020
self._request_streams.pop(request_stream_id, None)
10211021
else:

0 commit comments

Comments
 (0)