summary refs log tree commit diff
path: root/tests/replication/tcp/streams/_base.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Clean up replication unit tests. (#7490)Erik Johnston2020-05-131-307/+0
|
* Fix catchup-on-reconnect for the Federation Stream (#7374)Richard van der Hoff2020-05-051-7/+13
| | | | looks like we managed to break this during the refactorathon.
* Thread through instance name to replication client. (#7369)Erik Johnston2020-05-011-2/+2
| | | For in memory streams when fetching updates on workers we need to query the source of the stream, which currently is hard coded to be master. This PR threads through the source instance we received via `POSITION` through to the update function in each stream, which can then be passed to the replication client for in memory streams.
* Use `stream.current_token()` and remove `stream_positions()` (#7172)Erik Johnston2020-05-011-20/+10
| | | | We move the processing of typing and federation replication traffic into their handlers so that `Stream.current_token()` points to a valid token. This allows us to remove `get_streams_to_replicate()` and `stream_positions()`.
* Fix limit logic for EventsStream (#7358)Richard van der Hoff2020-04-291-17/+24
| | | | | | | | | | | | | | | | | | | * 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.
* Add some replication tests (#7278)Erik Johnston2020-04-281-11/+218
| | | | | | | Specifically some tests for the typing stream, which means we test streams that fetch missing updates via HTTP (rather than via the DB). We also shuffle things around a bit so that we create two separate `HomeServer` objects, rather than trying to insert a slaved store into places. Note: `test_typing.py` is heavily inspired by `test_receipts.py`
* Move client command handling out of TCP protocol (#7185)Erik Johnston2020-04-061-23/+15
| | | The aim here is to move the command handling out of the TCP protocol classes and to also merge the client and server command handling (so that we can reuse them for redis protocol). This PR simply moves the client paths to the new `ReplicationCommandHandler`, a future PR will move the server paths too.
* Move catchup of replication streams to worker. (#7024)Erik Johnston2020-03-251-14/+41
| | | This changes the replication protocol so that the server does not send down `RDATA` for rows that happened before the client connected. Instead, the server will send a `POSITION` and clients then query the database (or master out of band) to get up to date.
* Port synapse.replication.tcp to async/await (#6666)Erik Johnston2020-01-161-1/+1
| | | | | | | | | | * Port synapse.replication.tcp to async/await * Newsfile * Correctly document type of on_<FOO> functions as async * Don't be overenthusiastic with the asyncing....
* Implementation of MSC2314 (#6176)Amber Brown2019-11-281-0/+4
|
* Run Black on the tests again (#5170)Amber Brown2019-05-101-3/+3
|
* Fix bug where read-receipts lost their timestamps (#4927)Richard van der Hoff2019-03-251-0/+74
Make sure that they are sent correctly over the replication stream. Fixes: #4898