@@ -27,7 +27,7 @@ def macos_raise_ulimit():
2727
2828# There is a relatively low time limit for the server to respond with a resource error
2929# for this test. In resource limited environments such as CI, it doesn't seem to be enough,
30- # notably it is the first request that will take the longest to process as it also sets up
30+ # notably it is the first message that will take the longest to process as it also sets up
3131# the request. We can consider raising this delay in the runner to see if it helps.
3232#
3333# https://github.com/connectrpc/conformance/blob/main/internal/app/connectconformance/testsuites/data/server_message_size.yaml#L46
@@ -37,24 +37,22 @@ def macos_raise_ulimit():
3737]
3838
3939
40- @pytest .mark .parametrize ("server" , ["granian" , " gunicorn" , "hypercorn " ])
40+ @pytest .mark .parametrize ("server" , ["gunicorn" , "pyvoy " ])
4141def test_server_sync (server : str ) -> None :
42+ if server == "pyvoy" and sys .platform == "win32" :
43+ pytest .skip ("pyvoy not supported on Windows" )
44+
4245 args = maybe_patch_args_with_debug (
4346 [sys .executable , _server_py_path , "--mode" , "sync" , "--server" , server ]
4447 )
4548 opts = [
4649 # While Hypercorn and Granian supports HTTP/2 and WSGI, they both have simple wrappers
4750 # that reads the entire request body before running the application, which does not work for
48- # full duplex. There are no other popular WSGI servers that support HTTP/2, so in practice
49- # it cannot be supported. It is possible in theory following hyper-h2's example code in
50- # https://python-hyper.org/projects/hyper-h2/en/stable/wsgi-example.html though.
51+ # full duplex.
5152 "--skip" ,
5253 "**/bidi-stream/full-duplex/**" ,
5354 ]
5455 match server :
55- case "granian" | "hypercorn" :
56- # granian and hypercorn seem to have issues with concurrency
57- opts += ["--parallel" , "1" ]
5856 case "gunicorn" :
5957 # gunicorn doesn't support HTTP/2
6058 opts = ["--skip" , "**/HTTPVersion:2/**" ]
@@ -78,17 +76,14 @@ def test_server_sync(server: str) -> None:
7876 check = False ,
7977 )
8078 if result .returncode != 0 :
81- if server == "granian" :
82- # Even with low parallelism, some tests are flaky. We'll need to investigate further.
83- print ( # noqa: T201
84- f"Granian server tests failed, see output below, not treating as failure:\n { result .stdout } \n { result .stderr } "
85- )
86- return
8779 pytest .fail (f"\n { result .stdout } \n { result .stderr } " )
8880
8981
90- @pytest .mark .parametrize ("server" , ["daphne" , "granian" , "hypercorn " , "uvicorn" ])
82+ @pytest .mark .parametrize ("server" , ["daphne" , "pyvoy " , "uvicorn" ])
9183def test_server_async (server : str ) -> None :
84+ if server == "pyvoy" and sys .platform == "win32" :
85+ pytest .skip ("pyvoy not supported on Windows" )
86+
9287 args = maybe_patch_args_with_debug (
9388 [sys .executable , _server_py_path , "--mode" , "async" , "--server" , server ]
9489 )
@@ -104,9 +99,6 @@ def test_server_async(server: str) -> None:
10499 "--skip" ,
105100 "**/full-duplex/**" ,
106101 ]
107- case "granian" | "hypercorn" :
108- # granian and hypercorn seem to have issues with concurrency
109- opts = ["--parallel" , "1" ]
110102 case "uvicorn" :
111103 # uvicorn doesn't support HTTP/2
112104 opts = ["--skip" , "**/HTTPVersion:2/**" ]
@@ -115,6 +107,7 @@ def test_server_async(server: str) -> None:
115107 "go" ,
116108 "run" ,
117109 f"connectrpc.com/conformance/cmd/connectconformance@{ VERSION_CONFORMANCE } " ,
110+ "-v" ,
118111 "--conf" ,
119112 _config_path ,
120113 "--mode" ,
@@ -129,10 +122,4 @@ def test_server_async(server: str) -> None:
129122 check = False ,
130123 )
131124 if result .returncode != 0 :
132- if server == "granian" :
133- # Even with low parallelism, some tests are flaky. We'll need to investigate further.
134- print ( # noqa: T201
135- f"Granian server tests failed, see output below, not treating as failure:\n { result .stdout } \n { result .stderr } "
136- )
137- return
138125 pytest .fail (f"\n { result .stdout } \n { result .stderr } " )
0 commit comments