-
Notifications
You must be signed in to change notification settings - Fork 3
Run conformance test with pyvoy #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,7 +27,7 @@ def macos_raise_ulimit(): | |
|
|
||
| # There is a relatively low time limit for the server to respond with a resource error | ||
| # for this test. In resource limited environments such as CI, it doesn't seem to be enough, | ||
| # notably it is the first request that will take the longest to process as it also sets up | ||
| # notably it is the first message that will take the longest to process as it also sets up | ||
| # the request. We can consider raising this delay in the runner to see if it helps. | ||
| # | ||
| # 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(): | |
| ] | ||
|
|
||
|
|
||
| @pytest.mark.parametrize("server", ["granian", "gunicorn", "hypercorn"]) | ||
| @pytest.mark.parametrize("server", ["gunicorn", "pyvoy"]) | ||
| def test_server_sync(server: str) -> None: | ||
| if server == "pyvoy" and sys.platform == "win32": | ||
| pytest.skip("pyvoy not supported on Windows") | ||
|
|
||
| args = maybe_patch_args_with_debug( | ||
| [sys.executable, _server_py_path, "--mode", "sync", "--server", server] | ||
| ) | ||
| opts = [ | ||
| # While Hypercorn and Granian supports HTTP/2 and WSGI, they both have simple wrappers | ||
| # that reads the entire request body before running the application, which does not work for | ||
| # full duplex. There are no other popular WSGI servers that support HTTP/2, so in practice | ||
| # it cannot be supported. It is possible in theory following hyper-h2's example code in | ||
| # https://python-hyper.org/projects/hyper-h2/en/stable/wsgi-example.html though. | ||
| # TODO: Enable full-duplex in pyvoy | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This worked with some initial testing but I need to validate it some more |
||
| "--skip", | ||
| "**/bidi-stream/full-duplex/**", | ||
| ] | ||
| match server: | ||
| case "granian" | "hypercorn": | ||
| # granian and hypercorn seem to have issues with concurrency | ||
| opts += ["--parallel", "1"] | ||
| case "gunicorn": | ||
| # gunicorn doesn't support HTTP/2 | ||
| opts = ["--skip", "**/HTTPVersion:2/**"] | ||
|
|
@@ -78,17 +74,14 @@ def test_server_sync(server: str) -> None: | |
| check=False, | ||
| ) | ||
| if result.returncode != 0: | ||
| if server == "granian": | ||
| # Even with low parallelism, some tests are flaky. We'll need to investigate further. | ||
| print( # noqa: T201 | ||
| f"Granian server tests failed, see output below, not treating as failure:\n{result.stdout}\n{result.stderr}" | ||
| ) | ||
| return | ||
| pytest.fail(f"\n{result.stdout}\n{result.stderr}") | ||
|
|
||
|
|
||
| @pytest.mark.parametrize("server", ["daphne", "granian", "hypercorn", "uvicorn"]) | ||
| @pytest.mark.parametrize("server", ["daphne", "pyvoy", "uvicorn"]) | ||
| def test_server_async(server: str) -> None: | ||
| if server == "pyvoy" and sys.platform == "win32": | ||
| pytest.skip("pyvoy not supported on Windows") | ||
|
|
||
| args = maybe_patch_args_with_debug( | ||
| [sys.executable, _server_py_path, "--mode", "async", "--server", server] | ||
| ) | ||
|
|
@@ -104,9 +97,6 @@ def test_server_async(server: str) -> None: | |
| "--skip", | ||
| "**/full-duplex/**", | ||
| ] | ||
| case "granian" | "hypercorn": | ||
| # granian and hypercorn seem to have issues with concurrency | ||
| opts = ["--parallel", "1"] | ||
| case "uvicorn": | ||
| # uvicorn doesn't support HTTP/2 | ||
| opts = ["--skip", "**/HTTPVersion:2/**"] | ||
|
|
@@ -115,6 +105,7 @@ def test_server_async(server: str) -> None: | |
| "go", | ||
| "run", | ||
| f"connectrpc.com/conformance/cmd/connectconformance@{VERSION_CONFORMANCE}", | ||
| "-v", | ||
| "--conf", | ||
| _config_path, | ||
| "--mode", | ||
|
|
@@ -129,10 +120,4 @@ def test_server_async(server: str) -> None: | |
| check=False, | ||
| ) | ||
| if result.returncode != 0: | ||
| if server == "granian": | ||
| # Even with low parallelism, some tests are flaky. We'll need to investigate further. | ||
| print( # noqa: T201 | ||
| f"Granian server tests failed, see output below, not treating as failure:\n{result.stdout}\n{result.stderr}" | ||
| ) | ||
| return | ||
| pytest.fail(f"\n{result.stdout}\n{result.stderr}") | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
want to create an issue over in https://github.com/connectrpc/conformance/issues to tag a new version for connectrpc/conformance#1047? cc @jhump @doriable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure filed connectrpc/conformance#1050