summary refs log tree commit diff
path: root/tests/server.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-08-15 14:25:46 +0100
committerErik Johnston <erik@matrix.org>2018-08-15 14:25:46 +0100
commitef184caf30e69593b5f224f4a0ffde3605da2153 (patch)
treec4affbe31ecedbee84ddf70bfc2f2c39d15e831a /tests/server.py
parentUse federation handler function rather than duplicate (diff)
parentMerge pull request #3690 from matrix-org/neilj/change_prometheus_mau_metric_name (diff)
downloadsynapse-ef184caf30e69593b5f224f4a0ffde3605da2153.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/split_federation
Diffstat (limited to 'tests/server.py')
-rw-r--r--tests/server.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/server.py b/tests/server.py
index e249668d21..beb24cf032 100644
--- a/tests/server.py
+++ b/tests/server.py
@@ -136,6 +136,7 @@ class ThreadedMemoryReactorClock(MemoryReactorClock):
     """
     A MemoryReactorClock that supports callFromThread.
     """
+
     def callFromThread(self, callback, *args, **kwargs):
         """
         Make the callback fire in the next reactor iteration.
@@ -146,12 +147,15 @@ class ThreadedMemoryReactorClock(MemoryReactorClock):
         return d
 
 
-def setup_test_homeserver(*args, **kwargs):
+def setup_test_homeserver(cleanup_func, *args, **kwargs):
     """
     Set up a synchronous test server, driven by the reactor used by
     the homeserver.
     """
-    d = _sth(*args, **kwargs).result
+    d = _sth(cleanup_func, *args, **kwargs).result
+
+    if isinstance(d, Failure):
+        d.raiseException()
 
     # Make the thread pool synchronous.
     clock = d.get_clock()
@@ -184,9 +188,13 @@ def setup_test_homeserver(*args, **kwargs):
         """
         Threadless thread pool.
         """
+
         def start(self):
             pass
 
+        def stop(self):
+            pass
+
         def callInThreadWithCallback(self, onResult, function, *args, **kwargs):
             def _(res):
                 if isinstance(res, Failure):