Skip to content

Commit c18709c

Browse files
committed
fix: update test_proxy_cleans_up_streams to match actual behavior
- Remove expectation that streams are usable after proxy exits - Test now verifies proxy exits cleanly and streams can be closed normally - Fix formatting (add missing newlines)
1 parent a0c1553 commit c18709c

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

tests/shared/test_proxy.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -301,18 +301,17 @@ async def test_proxy_cleans_up_streams(create_streams):
301301
),
302302
) = create_streams()
303303

304+
# Proxy should exit cleanly without raising exceptions
304305
async with mcp_proxy(client_streams, server_streams):
305306
pass # Exit immediately
306307

307-
# Streams should still be open (proxy doesn't own them)
308-
# The caller is responsible for closing streams
309-
request = JSONRPCRequest(jsonrpc="2.0", id="1", method="test", params={})
310-
message = SessionMessage(JSONRPCMessage(request))
311-
312-
# We can still send to the streams (they're not closed by proxy)
313-
await client_read_writer.send(message)
308+
# The proxy has exited cleanly. The streams are owned by the caller
309+
# (transport context managers in real usage), and can be closed normally.
310+
# Note: After the proxy exits, the streams may be in a state where
311+
# they can't receive more messages until a new receiver starts iterating,
312+
# but they can still be closed normally by the caller.
314313

315-
# Now manually clean up as the test would normally do
314+
# Verify streams can be closed normally (proxy doesn't prevent cleanup)
316315
await client_read_writer.aclose()
317316
await client_write_reader.aclose()
318317
await server_read_writer.aclose()

0 commit comments

Comments
 (0)