diff options
author | Sean Quah <8349537+squahtx@users.noreply.github.com> | 2021-11-26 18:41:31 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-26 18:41:31 +0000 |
commit | ffd858aa68239aeaf06591d94c0ab1b3c185440f (patch) | |
tree | d8802699acbc78790551e6c232f12650b65cab75 /tests/replication | |
parent | Support expiry of refresh tokens and expiry of the overall session when refre... (diff) | |
download | synapse-ffd858aa68239aeaf06591d94c0ab1b3c185440f.tar.xz |
Add type hints to `synapse/storage/databases/main/events_worker.py` (#11411)
Also refactor the stream ID trackers/generators a bit and try to document them better.
Diffstat (limited to 'tests/replication')
-rw-r--r-- | tests/replication/test_sharded_event_persister.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/replication/test_sharded_event_persister.py b/tests/replication/test_sharded_event_persister.py index 0a6e4795ee..596ba5a0c9 100644 --- a/tests/replication/test_sharded_event_persister.py +++ b/tests/replication/test_sharded_event_persister.py @@ -17,6 +17,7 @@ from unittest.mock import patch from synapse.api.room_versions import RoomVersion from synapse.rest import admin from synapse.rest.client import login, room, sync +from synapse.storage.util.id_generators import MultiWriterIdGenerator from tests.replication._base import BaseMultiWorkerStreamTestCase from tests.server import make_request @@ -193,7 +194,10 @@ class EventPersisterShardTestCase(BaseMultiWorkerStreamTestCase): # # Worker2's event stream position will not advance until we call # __aexit__ again. - actx = worker_hs2.get_datastore()._stream_id_gen.get_next() + worker_store2 = worker_hs2.get_datastore() + assert isinstance(worker_store2._stream_id_gen, MultiWriterIdGenerator) + + actx = worker_store2._stream_id_gen.get_next() self.get_success(actx.__aenter__()) response = self.helper.send(room_id1, body="Hi!", tok=self.other_access_token) |