File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -344,9 +344,7 @@ async def _receive_loop(self) -> None:
344
344
# Send error to any pending request response streams immediately
345
345
for id , stream in list (self ._response_streams .items ()):
346
346
try :
347
- await stream .send (
348
- JSONRPCError (jsonrpc = "2.0" , id = id , error = error )
349
- )
347
+ await stream .send (JSONRPCError (jsonrpc = "2.0" , id = id , error = error ))
350
348
await stream .aclose ()
351
349
except Exception :
352
350
pass
Original file line number Diff line number Diff line change @@ -625,7 +625,8 @@ async def test_streamable_http_mid_call_disconnect(basic_server_port: int):
625
625
except OSError :
626
626
time .sleep (0.1 )
627
627
else : # pragma: no cover
628
- proc .kill (); proc .join (timeout = 2 )
628
+ proc .kill ()
629
+ proc .join (timeout = 2 )
629
630
pytest .fail ("Server failed to start in time" )
630
631
631
632
server_url = f"http://127.0.0.1:{ basic_server_port } /mcp"
@@ -649,7 +650,8 @@ async def invoke():
649
650
tg .start_soon (invoke )
650
651
# Give the request a moment to reach the server & tool to start (it sends a log notification)
651
652
await anyio .sleep (0.6 )
652
- proc .kill (); proc .join (timeout = 2 )
653
+ proc .kill ()
654
+ proc .join (timeout = 2 )
653
655
# Wait for propagated disconnect
654
656
with anyio .fail_after (10 ):
655
657
while "err" not in result :
@@ -660,7 +662,8 @@ async def invoke():
660
662
assert err .error .code == types .CONNECTION_CLOSED
661
663
finally :
662
664
if proc .is_alive (): # Safety cleanup
663
- proc .kill (); proc .join (timeout = 2 )
665
+ proc .kill ()
666
+ proc .join (timeout = 2 )
664
667
665
668
666
669
def test_session_termination (basic_server : None , basic_server_url : str ):
You can’t perform that action at this time.
0 commit comments