summary refs log tree commit diff
path: root/tests/handlers/test_presence.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-04-29 11:30:12 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2021-04-29 11:30:12 +0100
commit696e7df2e889fc982f0312555ce9f529f5e2a81b (patch)
tree3e65ceaf401363a177146b6b50a59a7048a6c888 /tests/handlers/test_presence.py
parentRevert "Experimental Federation Speedup (#9702)" (diff)
parentFix tight loop handling presence replication. (#9900) (diff)
downloadsynapse-696e7df2e889fc982f0312555ce9f529f5e2a81b.tar.xz
Merge branch 'release-v1.33.0' of github.com:matrix-org/synapse into matrix-org-hotfixes
Diffstat (limited to 'tests/handlers/test_presence.py')
-rw-r--r--tests/handlers/test_presence.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/handlers/test_presence.py b/tests/handlers/test_presence.py

index 61271cd084..ce330e79cc 100644 --- a/tests/handlers/test_presence.py +++ b/tests/handlers/test_presence.py
@@ -509,6 +509,14 @@ class PresenceFederationQueueTestCase(unittest.HomeserverTestCase): self.assertCountEqual(rows, expected_rows) + now_token = self.queue.get_current_token(self.instance_name) + rows, upto_token, limited = self.get_success( + self.queue.get_replication_rows("master", upto_token, now_token, 10) + ) + self.assertEqual(upto_token, now_token) + self.assertFalse(limited) + self.assertCountEqual(rows, []) + def test_send_and_get_split(self): state1 = UserPresenceState.default("@user1:test") state2 = UserPresenceState.default("@user2:test") @@ -538,6 +546,20 @@ class PresenceFederationQueueTestCase(unittest.HomeserverTestCase): self.assertCountEqual(rows, expected_rows) + now_token = self.queue.get_current_token(self.instance_name) + rows, upto_token, limited = self.get_success( + self.queue.get_replication_rows("master", upto_token, now_token, 10) + ) + + self.assertEqual(upto_token, now_token) + self.assertFalse(limited) + + expected_rows = [ + (2, ("dest3", "@user3:test")), + ] + + self.assertCountEqual(rows, expected_rows) + def test_clear_queue_all(self): state1 = UserPresenceState.default("@user1:test") state2 = UserPresenceState.default("@user2:test")