Skip to content

Conversation

@anuraaga
Copy link
Collaborator

In preparation for writing a doc on deployment, I wanted to make sure the common app servers are all tested. This adds granian, gunicorn, and uvicorn.

While previously hypercorn was started directly, I switched to just using subprocess for all the servers. It was already pretty tedious to do programmatic start for hypercorn, and some servers like granian it's not practical since they need to control the main thread. Instead of having many different ways of starting a server by code, we get to instead have a consistent pattern with just different CLI flags so overall it seems like a win.

"--skip",
"**/bidi-stream/full-duplex/**",
]
# Servers often run out of file descriptors on macOS due to low default ulimit.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously with hypercorn, it would fail due to ulimit issue in a default macos shell without --parallel=1. For some reason with granian it would have issues even with the parallelism. But I realized it's not difficult to automatically increase ulimit like this, so I did so and removed the parallel limit.


_skipped_tests_async = [
"--skip",
# There seems to be a hypercorn bug with HTTP/1 and request termination.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to only have been happening with the low ulimit

@anuraaga anuraaga changed the title Run conformance tests with granian, gunicorn, uvicorn too. Run conformance tests with granian, gunicorn, uvicorn too Oct 15, 2025
@anuraaga anuraaga marked this pull request as draft October 15, 2025 15:05
@anuraaga anuraaga force-pushed the server-subprocess branch 2 times, most recently from 23251a3 to be6d91f Compare October 15, 2025 15:12
@anuraaga
Copy link
Collaborator Author

While I could work through some flakiness locally in docker, looks like there is still some issue will check it out

@anuraaga anuraaga force-pushed the server-subprocess branch 3 times, most recently from f3ba171 to be0d36f Compare October 16, 2025 05:29
@anuraaga anuraaga marked this pull request as ready for review October 16, 2025 05:46
@anuraaga
Copy link
Collaborator Author

Got 3 runs in a row to succeed so hopefully this is fine now but let's keep an eye out for flakiness. I will also see if I can understand why granian would have issues with concurrency since in other testing I've found it to work pretty well.

):
# Granian seems to have a bug that it prints out 0 rather than the resolved port,
# so we need to determine it ourselves. If we see race conditions because of it,
# we can set max-servers=1 in the runner.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

want to add a ref: https://github.com/emmett-framework/granian/issues/711 to this comment so we can revisit when fixed?

env=_server_env(request),
)
stdout = proc.stdout
assert stdout is not None # noqa: S101
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we just disable the ruff rule that checks for assert usage in conformance/ or conformance/test?

Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
@anuraaga
Copy link
Collaborator Author

Sorry for the notification spam - I had good luck yesterday but very much not so today. In the end

  • Allowed Granian to pass even with failures. If there's no progress on that front I'll remove it from CI

  • Reduced parallelism for hypercorn, to match current head. It still has http2 stream issues with concurrence it seems

It means I can't find a good solution for http/2 on python yet. Will keep on trying

@anuraaga anuraaga merged commit 92959a3 into connectrpc:main Oct 17, 2025
41 of 57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants