mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-28 14:22:12 -04:00
Add config settings for background update parameters (#11980)
This commit is contained in:
parent
e6a106fd5e
commit
ef3619e61d
9 changed files with 430 additions and 34 deletions
|
@ -39,6 +39,7 @@ class BackgroundUpdatesTestCase(unittest.HomeserverTestCase):
|
|||
self.store = hs.get_datastores().main
|
||||
self.admin_user = self.register_user("admin", "pass", admin=True)
|
||||
self.admin_user_tok = self.login("admin", "pass")
|
||||
self.updater = BackgroundUpdater(hs, self.store.db_pool)
|
||||
|
||||
@parameterized.expand(
|
||||
[
|
||||
|
@ -135,10 +136,10 @@ class BackgroundUpdatesTestCase(unittest.HomeserverTestCase):
|
|||
"""Test the status API works with a background update."""
|
||||
|
||||
# Create a new background update
|
||||
|
||||
self._register_bg_update()
|
||||
|
||||
self.store.db_pool.updates.start_doing_background_updates()
|
||||
|
||||
self.reactor.pump([1.0, 1.0, 1.0])
|
||||
|
||||
channel = self.make_request(
|
||||
|
@ -158,7 +159,7 @@ class BackgroundUpdatesTestCase(unittest.HomeserverTestCase):
|
|||
"average_items_per_ms": 0.1,
|
||||
"total_duration_ms": 1000.0,
|
||||
"total_item_count": (
|
||||
BackgroundUpdater.DEFAULT_BACKGROUND_BATCH_SIZE
|
||||
self.updater.default_background_batch_size
|
||||
),
|
||||
}
|
||||
},
|
||||
|
@ -213,7 +214,7 @@ class BackgroundUpdatesTestCase(unittest.HomeserverTestCase):
|
|||
"average_items_per_ms": 0.1,
|
||||
"total_duration_ms": 1000.0,
|
||||
"total_item_count": (
|
||||
BackgroundUpdater.DEFAULT_BACKGROUND_BATCH_SIZE
|
||||
self.updater.default_background_batch_size
|
||||
),
|
||||
}
|
||||
},
|
||||
|
@ -242,7 +243,7 @@ class BackgroundUpdatesTestCase(unittest.HomeserverTestCase):
|
|||
"average_items_per_ms": 0.1,
|
||||
"total_duration_ms": 1000.0,
|
||||
"total_item_count": (
|
||||
BackgroundUpdater.DEFAULT_BACKGROUND_BATCH_SIZE
|
||||
self.updater.default_background_batch_size
|
||||
),
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue