summary refs log tree commit diff
path: root/tests/unittest.py
diff options
context:
space:
mode:
authorSean Quah <seanq@element.io>2021-11-30 12:18:02 +0000
committerSean Quah <seanq@element.io>2021-11-30 12:18:02 +0000
commit07580acdc08807d623f0fe4953dbed34b6ff2d87 (patch)
tree976c48084bd9ef2980410bbc4b9744c28bf6a181 /tests/unittest.py
parentAdd tests for remote spaces (diff)
parentSupport the stable /hierarchy endpoint from MSC2946 (#11329) (diff)
downloadsynapse-07580acdc08807d623f0fe4953dbed34b6ff2d87.tar.xz
Merge branch 'develop' into squah/leave_space_admin_api
Diffstat (limited to 'tests/unittest.py')
-rw-r--r--tests/unittest.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/unittest.py b/tests/unittest.py

index c9a08a3420..eea0903f05 100644 --- a/tests/unittest.py +++ b/tests/unittest.py
@@ -331,12 +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 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): @@ -495,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()