-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
[BUG] Parametrization incompatibility with falcon ASGI apps #2136
Comments
Thank you so much for reporting this! I’ll take a look at it soon |
I think the issue is that Schemathesis relies on starlette too much when working with ASGI :/ it should be more generic |
#2150 will solve the detection issue, then I am going to adjust the test client so it sends the ASGI spec version to the app. As far as I can see, the ASGI spec defaults to |
…3-only apps Ref: #2136 Signed-off-by: Dmitry Dygalo <dmitry@dygalo.dev>
…3-only apps Ref: #2136 Signed-off-by: Dmitry Dygalo <dmitry@dygalo.dev>
Confirming that 3.27.1 has resolved this for me. Thanks a bunch, this is much appreciated! |
Awesome! Feel free to reach out in case of any other issues! :) |
Checklist
Describe the bug
We've recently upgraded from schemathesis 3.19.5, and our tests that involve parametrized schemas from pytest fixtures have begun to hang indefinitely when using
case.call_asgi
. I noticed that thecall_asgi
method was just recently deprecated, so I switched the tests to use justcase.call
instead, and they no longer hang but instead error out due to callingrun_wsgi_app
with an ASGI app. The issue is present for both OpenAPI and GraphQL schemas.Digging in to the issue a little bit, I discovered that these issues only present themselves when using falcon as the ASGI framework. When using FastAPI instead, for example, everything works just fine. I've been unable to dig any further and determine whether this is a bug in falcon, so my apologies if this is not the right venue for this bug, but it seems to have something to do with the way the starlette testclient interacts with the falcon app. Specifically, the hanging seems to occur in the testclient's
__exit__
method, where it's waiting for everything to shutdown.To Reproduce
The following test code should demonstrate both the failing test with the new
case.call
method, and the hanging test with the oldcase.call_asgi
method. In addition, there are tests using the exact same code/schema via a fastapi app that will pass:Please include a minimal API schema causing this issue:
{'openapi': '3.0.2', 'info': {'description': ''}, 'paths': {'/info': {'get': {'summary': '', 'parameters': [], 'responses': {'200': {'description': ''}}}}}}
Expected behavior
The result of the above tests should be independent of the ASGI framework used.
Environment
Additional context
Here are the versions of the libraries directly involved with running the tests that I've been using to reproduce the issue:
The text was updated successfully, but these errors were encountered: