-
- Downloads
Fix limit logic for EventsStream (#7358)
* Factor out functions for injecting events into database I want to add some more flexibility to the tools for injecting events into the database, and I don't want to clutter up HomeserverTestCase with them, so let's factor them out to a new file. * Rework TestReplicationDataHandler This wasn't very easy to work with: the mock wrapping was largely superfluous, and it's useful to be able to inspect the received rows, and clear out the received list. * Fix AssertionErrors being thrown by EventsStream Part of the problem was that there was an off-by-one error in the assertion, but also the limit logic was too simple. Fix it all up and add some tests.
Showing
- changelog.d/7358.bugfix 1 addition, 0 deletionschangelog.d/7358.bugfix
- synapse/replication/tcp/handler.py 3 additions, 1 deletionsynapse/replication/tcp/handler.py
- synapse/replication/tcp/streams/events.py 8 additions, 14 deletionssynapse/replication/tcp/streams/events.py
- synapse/server.pyi 5 additions, 0 deletionssynapse/server.pyi
- synapse/storage/data_stores/main/events_worker.py 60 additions, 4 deletionssynapse/storage/data_stores/main/events_worker.py
- tests/replication/tcp/streams/_base.py 24 additions, 17 deletionstests/replication/tcp/streams/_base.py
- tests/replication/tcp/streams/test_events.py 417 additions, 0 deletionstests/replication/tcp/streams/test_events.py
- tests/replication/tcp/streams/test_receipts.py 9 additions, 1 deletiontests/replication/tcp/streams/test_receipts.py
- tests/replication/tcp/streams/test_typing.py 8 additions, 3 deletionstests/replication/tcp/streams/test_typing.py
- tests/rest/client/v1/utils.py 1 addition, 1 deletiontests/rest/client/v1/utils.py
- tests/test_utils/__init__.py 20 additions, 0 deletionstests/test_utils/__init__.py
- tests/test_utils/event_injection.py 96 additions, 0 deletionstests/test_utils/event_injection.py
- tests/unittest.py 4 additions, 26 deletionstests/unittest.py
- tox.ini 2 additions, 0 deletionstox.ini
Loading
Please register or sign in to comment