Skip to content

asgi: get valid/invalid http tests to pass#3464

Open
pajod wants to merge 1 commit intobenoitc:masterfrom
pajod:patch-test-asgi
Open

asgi: get valid/invalid http tests to pass#3464
pajod wants to merge 1 commit intobenoitc:masterfrom
pajod:patch-test-asgi

Conversation

@pajod
Copy link
Contributor

@pajod pajod commented Jan 25, 2026

There are 101 perfectly fine HTTP test cases in tests/requests/**.http many of which of no use for testing the ASGI workers right now. Let's fix that.

  • change asgi HTTP error exceptions to match base sync worker
  • use StopAsyncIteration in async def
    • my reasoning here is that sticking with this signalling is exclusively practical when the exception can bubble in async iterator
  • override config in cases tests/test_asgi.py::MockConfig has non-default
    • those test cases actually care about the configs set there, and though this could equally be fixed by switching the test to use the default settings instead, explicit is better than implicit

(updated tests/treq.py and new tests/test_nginx.py intentionally omitted here, they match most of my parallel PRs)

* change asgi HTTP error exceptions to match base sync worker
* use StopAsyncIteration in async def
* override config in cases tests/test_asgi.py::MockConfig has non-default
@pajod
Copy link
Contributor Author

pajod commented Jan 25, 2026

Not resolved here (because invalid requests were never checked as thoroughly as valid ones - so its not strictly needed for those tests), but a good candidate after some refactoring: dumping a traceback inplace of logging the warning and responding

gunicorn.http.errors.InvalidRequestLine: Invalid HTTP request line: ''

@benoitc
Copy link
Owner

benoitc commented Jan 25, 2026

i suggest to wait for the deduplication refactoring . Coming week I will release the 25.0?0 with current state. Then what about making it for 25.1 ?

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