13
13
async def test_windows_stdio_client_no_hang ():
14
14
"""
15
15
Test for issue #552: stdio_client hangs on Windows 11.
16
-
17
- This test verifies that the stdio_client can be created and properly
16
+
17
+ This test verifies that the stdio_client can be created and properly
18
18
closed on Windows without hanging, even when the subprocess exits immediately.
19
19
The original issue was that the client would hang indefinitely.
20
20
"""
@@ -24,7 +24,7 @@ async def test_windows_stdio_client_no_hang():
24
24
command = sys .executable ,
25
25
args = ["-c" , "import sys; sys.exit(0)" ],
26
26
)
27
-
27
+
28
28
# The test passes if we can attempt to create the client without hanging
29
29
# We expect it to fail quickly when the subprocess exits
30
30
with anyio .fail_after (5 ): # 5 second timeout - should fail much faster
@@ -39,7 +39,7 @@ async def test_windows_stdio_client_no_hang():
39
39
async def test_windows_stdio_client_json_echo ():
40
40
"""
41
41
Test stdio_client with a JSON echo server on Windows.
42
-
42
+
43
43
This test creates a subprocess that echoes JSON-RPC messages,
44
44
verifying that the stdio_client can communicate properly on Windows.
45
45
"""
@@ -60,16 +60,16 @@ async def test_windows_stdio_client_json_echo():
60
60
# If not valid JSON, just exit
61
61
break
62
62
""" ).strip ()
63
-
63
+
64
64
params = StdioServerParameters (
65
65
command = sys .executable ,
66
66
args = ["-c" , echo_script ],
67
67
)
68
-
68
+
69
69
# Test should complete without hanging
70
70
with anyio .fail_after (5 ):
71
71
async with stdio_client (params ) as (read , write ):
72
72
# The stdio_client should establish connection without hanging
73
73
# Just creating the client successfully is the main test
74
74
# The original issue was it would hang here
75
- pass
75
+ pass
0 commit comments