@@ -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,20 @@ 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 = [
46- # While Hypercorn and Granian supports HTTP/2 and WSGI, they both have simple wrappers
47- # 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.
49+ # TODO: Enable full-duplex in pyvoy
5150 "--skip" ,
5251 "**/bidi-stream/full-duplex/**" ,
5352 ]
5453 match server :
55- case "granian" | "hypercorn" :
56- # granian and hypercorn seem to have issues with concurrency
57- opts += ["--parallel" , "1" ]
5854 case "gunicorn" :
5955 # gunicorn doesn't support HTTP/2
6056 opts = ["--skip" , "**/HTTPVersion:2/**" ]
@@ -78,17 +74,14 @@ def test_server_sync(server: str) -> None:
7874 check = False ,
7975 )
8076 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
8777 pytest .fail (f"\n { result .stdout } \n { result .stderr } " )
8878
8979
90- @pytest .mark .parametrize ("server" , ["daphne" , "granian" , "hypercorn " , "uvicorn" ])
80+ @pytest .mark .parametrize ("server" , ["daphne" , "pyvoy " , "uvicorn" ])
9181def test_server_async (server : str ) -> None :
82+ if server == "pyvoy" and sys .platform == "win32" :
83+ pytest .skip ("pyvoy not supported on Windows" )
84+
9285 args = maybe_patch_args_with_debug (
9386 [sys .executable , _server_py_path , "--mode" , "async" , "--server" , server ]
9487 )
@@ -104,9 +97,6 @@ def test_server_async(server: str) -> None:
10497 "--skip" ,
10598 "**/full-duplex/**" ,
10699 ]
107- case "granian" | "hypercorn" :
108- # granian and hypercorn seem to have issues with concurrency
109- opts = ["--parallel" , "1" ]
110100 case "uvicorn" :
111101 # uvicorn doesn't support HTTP/2
112102 opts = ["--skip" , "**/HTTPVersion:2/**" ]
@@ -115,6 +105,7 @@ def test_server_async(server: str) -> None:
115105 "go" ,
116106 "run" ,
117107 f"connectrpc.com/conformance/cmd/connectconformance@{ VERSION_CONFORMANCE } " ,
108+ "-v" ,
118109 "--conf" ,
119110 _config_path ,
120111 "--mode" ,
@@ -129,10 +120,4 @@ def test_server_async(server: str) -> None:
129120 check = False ,
130121 )
131122 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
138123 pytest .fail (f"\n { result .stdout } \n { result .stderr } " )
0 commit comments