synapse/tests
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
..
api Add a short sleep if the request is rate-limited (#17210) 2024-05-18 12:03:30 +01:00
app Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
appservice Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
config Add config option redis.password_path (#17717) 2024-10-07 09:46:51 +01:00
crypto Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
events Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
federation Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
handlers Issue one time keys in upload order (#17903) 2024-11-06 22:21:06 +00:00
http Fix cancellation tests with new Twisted. (#17906) 2024-11-07 15:26:14 +00:00
logging Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
media Add media tests for a CMYK JPEG image (#17786) 2024-10-23 18:26:01 +01:00
metrics Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
module_api Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
push Remove support for python 3.8 (#17908) 2024-11-06 19:36:01 +00:00
replication Fix bug in sliding sync when using old DB. (#17398) 2024-07-08 20:30:23 +01:00
rest Sliding Sync: Lazy-loading room members on incremental sync (remember memberships) (#17809) 2024-11-04 10:17:58 -06:00
scripts Update license headers 2023-11-21 15:29:58 -05:00
server_notices Sliding Sync: Add cache to `get_tags_for_room(...)` (#17730) 2024-09-19 12:43:26 +01:00
state Update license headers 2023-11-21 15:29:58 -05:00
storage Remove support for python 3.8 (#17908) 2024-11-06 19:36:01 +00:00
test_utils Add media tests for a CMYK JPEG image (#17786) 2024-10-23 18:26:01 +01:00
types Use immutabledict instead of frozendict (#15113) 2023-03-22 17:15:34 +00:00
util Remove support for python 3.8 (#17908) 2024-11-06 19:36:01 +00:00
__init__.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
server.py Fix other unit tests with latest twisted (#17907) 2024-11-07 10:11:13 +00:00
test_distributor.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_event_auth.py Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
test_federation.py Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
test_mau.py Update license headers 2023-11-21 15:29:58 -05:00
test_phone_home.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_rust.py Add missing type hints to tests. (#15027) 2023-02-08 19:52:37 +00:00
test_server.py Upgrade locked dependency on Twisted to 24.7.0rc1. (#17502) 2024-07-30 15:23:23 +01:00
test_state.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_terms_auth.py Update license headers 2023-11-21 15:29:58 -05:00
test_test_utils.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_types.py Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
test_visibility.py Include user membership on events (#17282) 2024-06-13 21:45:54 +00:00
unittest.py Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
utils.py Improve lock performance when a lot of locks are waiting (#16840) 2024-03-14 13:49:54 +00:00