summary refs log tree commit diff
path: root/tests/unittest.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-03-19 17:12:37 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2020-03-19 17:12:37 +0000
commit60baffdaa466a28da7b7495ec159093452944429 (patch)
tree203fb6f3d0430ffa074dcbab0c7230b4d2328753 /tests/unittest.py
parentReplace /admin/v1/users_paginate endpoint with /admin/v2/users (#5925) (diff)
parentMerge pull request #6469 from matrix-org/erikj/make_database_class (diff)
downloadsynapse-60baffdaa466a28da7b7495ec159093452944429.tar.xz
Merge pull request #6469 from matrix-org/erikj/make_database_class
* commit 'f3ea2f5a0':
  Remove unused var
  Fix DB scripts
  Newsfile
  Move background update handling out of store
  Comments
  Move DB pool and helper functions into dedicated Database class
Diffstat (limited to 'tests/unittest.py')
-rw-r--r--tests/unittest.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/unittest.py b/tests/unittest.py

index 295573bc46..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 @@ -544,7 +546,7 @@ class HomeserverTestCase(TestCase): Add the given event as an extremity to the room. """ self.get_success( - self.hs.get_datastore().simple_insert( + self.hs.get_datastore().db.simple_insert( table="event_forward_extremities", values={"room_id": room_id, "event_id": event_id}, desc="test_add_extremity",