summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorErik Johnston <erikj@element.io>2024-06-24 14:15:13 +0100
committerGitHub <noreply@github.com>2024-06-24 14:15:13 +0100
commitcf711ac03cd88b70568b3ac9df4aed4de5b33523 (patch)
tree5903fca3c4fa9ae66c23bafcb4746a8c6365d890 /tests
parentTidy up integer parsing (#17339) (diff)
downloadsynapse-cf711ac03cd88b70568b3ac9df4aed4de5b33523.tar.xz
Reduce device lists replication traffic. (#17333)
Reduce the replication traffic of device lists, by not sending every
destination that needs to be sent the device list update over
replication. Instead a "hosts to send to have been calculated"
notification over replication, and then federation senders read the
destinations from the DB.

For non federation senders this should heavily reduce the impact of a
user in many large rooms changing a device.
Diffstat (limited to 'tests')
-rw-r--r--tests/storage/test_devices.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/storage/test_devices.py b/tests/storage/test_devices.py
index 7f975d04ff..ba01b038ab 100644
--- a/tests/storage/test_devices.py
+++ b/tests/storage/test_devices.py
@@ -36,6 +36,14 @@ class DeviceStoreTestCase(HomeserverTestCase):
     def prepare(self, reactor: MemoryReactor, clock: Clock, hs: HomeServer) -> None:
         self.store = hs.get_datastores().main
 
+    def default_config(self) -> JsonDict:
+        config = super().default_config()
+
+        # We 'enable' federation otherwise `get_device_updates_by_remote` will
+        # throw an exception.
+        config["federation_sender_instances"] = ["master"]
+        return config
+
     def add_device_change(self, user_id: str, device_ids: List[str], host: str) -> None:
         """Add a device list change for the given device to
         `device_lists_outbound_pokes` table.