summary refs log tree commit diff
path: root/tests/unittest.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2021-11-29 16:57:06 +0000
committerGitHub <noreply@github.com>2021-11-29 17:57:06 +0100
commitd08ef6f155971717d2c6dbd78c89312afd4d84fa (patch)
tree8243c6ca2c4a99b0eeb1e6d248a8aa90b5d39901 /tests/unittest.py
parentReturn the stable `event` field from `/send_join` per MSC3083. (#11413) (diff)
downloadsynapse-d08ef6f155971717d2c6dbd78c89312afd4d84fa.tar.xz
Make background updates controllable via a plugin (#11306)
Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
Diffstat (limited to 'tests/unittest.py')
-rw-r--r--tests/unittest.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/unittest.py b/tests/unittest.py

index 165aafc574..eea0903f05 100644 --- a/tests/unittest.py +++ b/tests/unittest.py
@@ -331,17 +331,16 @@ class HomeserverTestCase(TestCase): time.sleep(0.01) def wait_for_background_updates(self) -> None: - """ - Block until all background database updates have completed. + """Block until all background database updates have completed. - Note that callers must ensure that's a store property created on the + Note that callers must ensure there's a store property created on the testcase. """ while not self.get_success( self.store.db_pool.updates.has_completed_background_updates() ): self.get_success( - self.store.db_pool.updates.do_next_background_update(100), by=0.1 + self.store.db_pool.updates.do_next_background_update(False), by=0.1 ) def make_homeserver(self, reactor, clock): @@ -500,8 +499,7 @@ class HomeserverTestCase(TestCase): async def run_bg_updates(): with LoggingContext("run_bg_updates"): - while not await stor.db_pool.updates.has_completed_background_updates(): - await stor.db_pool.updates.do_next_background_update(1) + self.get_success(stor.db_pool.updates.run_background_updates(False)) hs = setup_test_homeserver(self.addCleanup, *args, **kwargs) stor = hs.get_datastore()