diff options
author | Amber Brown <hawkowl@atleastfornow.net> | 2019-01-24 21:31:54 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-24 21:31:54 +1100 |
commit | 58f6c4818337364dd9c6bf01062e7b0dadcb8a25 (patch) | |
tree | 505122b391e64d171dea79efb697ba1245d45010 /tests/unittest.py | |
parent | Don't send IP addresses as SNI (#4452) (diff) | |
download | synapse-58f6c4818337364dd9c6bf01062e7b0dadcb8a25.tar.xz |
Use native UPSERTs where possible (#4306)
Diffstat (limited to 'tests/unittest.py')
-rw-r--r-- | tests/unittest.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/unittest.py b/tests/unittest.py index 78d2f740f9..cda549c783 100644 --- a/tests/unittest.py +++ b/tests/unittest.py @@ -96,7 +96,7 @@ class TestCase(unittest.TestCase): method = getattr(self, methodName) - level = getattr(method, "loglevel", getattr(self, "loglevel", logging.ERROR)) + level = getattr(method, "loglevel", getattr(self, "loglevel", logging.WARNING)) @around(self) def setUp(orig): @@ -333,7 +333,15 @@ class HomeserverTestCase(TestCase): """ kwargs = dict(kwargs) kwargs.update(self._hs_args) - return setup_test_homeserver(self.addCleanup, *args, **kwargs) + 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)) + + return hs def pump(self, by=0.0): """ |