synapse/tests/http
Erik Johnston d0fc1e904a
Fix cancellation tests with new Twisted. (#17906)
The latest Twisted release changed how they implemented `__await__` on
deferreds, which broke the machinery we used to test cancellation.

This PR changes things a bit to instead patch the `__await__` method,
which is a stable API. This mostly doesn't change the core logic, except
for fixing two bugs:
  - We previously did not intercept all await points
- After cancellation we now need to not only unblock currently blocked
await points, but also make sure we don't block any future await points.

c.f. https://github.com/twisted/twisted/pull/12226

---------

Co-authored-by: Devon Hudson <devon.dmytro@gmail.com>
2024-11-07 15:26:14 +00:00
..
federation Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
server Fix cancellation tests with new Twisted. (#17906) 2024-11-07 15:26:14 +00:00
__init__.py Update license headers 2023-11-21 15:29:58 -05:00
ca.crt Tests for SSL certs for federation connections 2019-06-10 16:14:20 +01:00
ca.key Tests for SSL certs for federation connections 2019-06-10 16:14:20 +01:00
server.key Tests for SSL certs for federation connections 2019-06-10 16:14:20 +01:00
test_additional_resource.py Update license headers 2023-11-21 15:29:58 -05:00
test_client.py Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
test_endpoint.py Update license headers 2023-11-21 15:29:58 -05:00
test_matrixfederationclient.py Remove usage of internal header encoding API (#17894) 2024-11-04 12:20:07 -06:00
test_proxy.py Remove usage of internal header encoding API (#17894) 2024-11-04 12:20:07 -06:00
test_proxyagent.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_servlet.py Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
test_simple_client.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_site.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00