Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: server: incompatibility with aiohttp 3.9
Previously, the test suite repeatedly crashed in CI when running tests that involved a browser disconnecting unexpectedly, such as the channels or bucket tests. Seemingly, this started with the release of aiohttp 3.9 which introduced web handler cancellation. https://docs.aiohttp.org/en/v3.9.0/web_advanced.html#web-handler-cancellation Web handler cancellation means that aiohttp cancels the asyncio tasks of aiohttp request handlers which encounter a `ConnectionClosedError`. In Lona, the teardown code for connections gets called within aiohttp request handlers, meaning that sometimes the connection teardown code does not run. Web handler cancellation is an opt-in feature that is not enabled by default, nor is it enabled by Lona. Although, it is enabled by pytest-aiohttp, which is the reason it only crashes in CI. As proposed in the aiohttp documentation, this patch adds a method to `lona.Server` that shields all aiohttp request handlers from cancellation. Signed-off-by: Florian Scherf <[email protected]>
- Loading branch information