summary refs log tree commit diff
path: root/tests/unittest.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-12-04 15:09:36 +0000
committerErik Johnston <erik@matrix.org>2019-12-05 11:11:26 +0000
commit4a33a6dd19590b8e6626a5af5a69507dc11236f8 (patch)
tree4d4f1f826a93afbd47e50562949a0e2f51ddb827 /tests/unittest.py
parentComments (diff)
downloadsynapse-4a33a6dd19590b8e6626a5af5a69507dc11236f8.tar.xz
Move background update handling out of store
Diffstat (limited to 'tests/unittest.py')
-rw-r--r--tests/unittest.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/unittest.py b/tests/unittest.py
index fc856a574a..68d245ec9f 100644
--- a/tests/unittest.py
+++ b/tests/unittest.py
@@ -401,10 +401,12 @@ class HomeserverTestCase(TestCase):
         hs = setup_test_homeserver(self.addCleanup, *args, **kwargs)
         stor = hs.get_datastore()
 
-        # Run the database background updates.
-        if hasattr(stor, "do_next_background_update"):
-            while not self.get_success(stor.has_completed_background_updates()):
-                self.get_success(stor.do_next_background_update(1))
+        # Run the database background updates, when running against "master".
+        if hs.__class__.__name__ == "TestHomeServer":
+            while not self.get_success(
+                stor.db.updates.has_completed_background_updates()
+            ):
+                self.get_success(stor.db.updates.do_next_background_update(1))
 
         return hs