diff options
author | Erik Johnston <erik@matrix.org> | 2022-06-06 11:24:12 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-06 09:24:12 +0100 |
commit | e3163e2e11cf8bffa4cb3e58ac0b86a83eca314c (patch) | |
tree | 639271e4b4d4157b95047f801f6b22bf39a24f08 /tests/storage/test_events.py | |
parent | Remove groups code from synapse_port_db. (#12899) (diff) | |
download | synapse-e3163e2e11cf8bffa4cb3e58ac0b86a83eca314c.tar.xz |
Reduce the amount of state we pull from the DB (#12811)
Diffstat (limited to 'tests/storage/test_events.py')
-rw-r--r-- | tests/storage/test_events.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/storage/test_events.py b/tests/storage/test_events.py index a76718e8f9..2ff88e64a5 100644 --- a/tests/storage/test_events.py +++ b/tests/storage/test_events.py @@ -32,6 +32,7 @@ class ExtremPruneTestCase(HomeserverTestCase): def prepare(self, reactor, clock, homeserver): self.state = self.hs.get_state_handler() self._persistence = self.hs.get_storage_controllers().persistence + self._state_storage_controller = self.hs.get_storage_controllers().state self.store = self.hs.get_datastores().main self.register_user("user", "pass") @@ -104,7 +105,7 @@ class ExtremPruneTestCase(HomeserverTestCase): ) state_before_gap = self.get_success( - self.state.get_current_state_ids(self.room_id) + self._state_storage_controller.get_current_state_ids(self.room_id) ) self.persist_event(remote_event_2, state=state_before_gap) @@ -137,7 +138,9 @@ class ExtremPruneTestCase(HomeserverTestCase): # setting. The state resolution across the old and new event will then # include it, and so the resolved state won't match the new state. state_before_gap = dict( - self.get_success(self.state.get_current_state_ids(self.room_id)) + self.get_success( + self._state_storage_controller.get_current_state_ids(self.room_id) + ) ) state_before_gap.pop(("m.room.history_visibility", "")) @@ -181,7 +184,7 @@ class ExtremPruneTestCase(HomeserverTestCase): ) state_before_gap = self.get_success( - self.state.get_current_state_ids(self.room_id) + self._state_storage_controller.get_current_state_ids(self.room_id) ) self.persist_event(remote_event_2, state=state_before_gap) @@ -213,7 +216,7 @@ class ExtremPruneTestCase(HomeserverTestCase): ) state_before_gap = self.get_success( - self.state.get_current_state_ids(self.room_id) + self._state_storage_controller.get_current_state_ids(self.room_id) ) self.persist_event(remote_event_2, state=state_before_gap) @@ -255,7 +258,7 @@ class ExtremPruneTestCase(HomeserverTestCase): ) state_before_gap = self.get_success( - self.state.get_current_state_ids(self.room_id) + self._state_storage_controller.get_current_state_ids(self.room_id) ) self.persist_event(remote_event_2, state=state_before_gap) @@ -299,7 +302,7 @@ class ExtremPruneTestCase(HomeserverTestCase): ) state_before_gap = self.get_success( - self.state.get_current_state_ids(self.room_id) + self._state_storage_controller.get_current_state_ids(self.room_id) ) self.persist_event(remote_event_2, state=state_before_gap) @@ -335,7 +338,7 @@ class ExtremPruneTestCase(HomeserverTestCase): ) state_before_gap = self.get_success( - self.state.get_current_state_ids(self.room_id) + self._state_storage_controller.get_current_state_ids(self.room_id) ) self.persist_event(remote_event_2, state=state_before_gap) |