mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-20 06:14:10 -04:00
Fix tight loop handling presence replication. (#9900)
Only affects workers. Introduced in #9819. Fixes #9899.
This commit is contained in:
parent
8ba086980d
commit
e4ab8676b4
3 changed files with 46 additions and 1 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue