summary refs log tree commit diff
path: root/tests/test_server.py
diff options
context:
space:
mode:
authorEric Eastwood <erice@element.io>2023-07-10 11:10:20 -0500
committerGitHub <noreply@github.com>2023-07-10 11:10:20 -0500
commitc9bf644fa0c2c06f8143b14ccdb655feebed97df (patch)
tree97589dc35b97f87f23f3fd579b5015bec17a40c5 /tests/test_server.py
parentRevert "Placeholder changelog" (diff)
downloadsynapse-c9bf644fa0c2c06f8143b14ccdb655feebed97df.tar.xz
Revert "Federation outbound proxy" (#15910)
Revert "Federation outbound proxy (#15773)"

This reverts commit b07b14b494ae1dd564b4c44f844c9a9545b3d08a.
Diffstat (limited to 'tests/test_server.py')
-rw-r--r--tests/test_server.py33
1 files changed, 13 insertions, 20 deletions
diff --git a/tests/test_server.py b/tests/test_server.py
index fe5afebdcd..e266c06a2c 100644
--- a/tests/test_server.py
+++ b/tests/test_server.py
@@ -38,7 +38,7 @@ from tests.http.server._base import test_disconnect
 from tests.server import (
     FakeChannel,
     FakeSite,
-    get_clock,
+    ThreadedMemoryReactorClock,
     make_request,
     setup_test_homeserver,
 )
@@ -46,11 +46,12 @@ from tests.server import (
 
 class JsonResourceTests(unittest.TestCase):
     def setUp(self) -> None:
-        reactor, clock = get_clock()
-        self.reactor = reactor
+        self.reactor = ThreadedMemoryReactorClock()
+        self.hs_clock = Clock(self.reactor)
         self.homeserver = setup_test_homeserver(
             self.addCleanup,
-            clock=clock,
+            federation_http_client=None,
+            clock=self.hs_clock,
             reactor=self.reactor,
         )
 
@@ -208,13 +209,7 @@ class JsonResourceTests(unittest.TestCase):
 
 class OptionsResourceTests(unittest.TestCase):
     def setUp(self) -> None:
-        reactor, clock = get_clock()
-        self.reactor = reactor
-        self.homeserver = setup_test_homeserver(
-            self.addCleanup,
-            clock=clock,
-            reactor=self.reactor,
-        )
+        self.reactor = ThreadedMemoryReactorClock()
 
         class DummyResource(Resource):
             isLeaf = True
@@ -247,7 +242,6 @@ class OptionsResourceTests(unittest.TestCase):
             "1.0",
             max_request_body_size=4096,
             reactor=self.reactor,
-            federation_agent=self.homeserver.get_federation_http_client().agent,
         )
 
         # render the request and return the channel
@@ -350,8 +344,7 @@ class WrapHtmlRequestHandlerTests(unittest.TestCase):
             await self.callback(request)
 
     def setUp(self) -> None:
-        reactor, _ = get_clock()
-        self.reactor = reactor
+        self.reactor = ThreadedMemoryReactorClock()
 
     def test_good_response(self) -> None:
         async def callback(request: SynapseRequest) -> None:
@@ -469,9 +462,9 @@ class DirectServeJsonResourceCancellationTests(unittest.TestCase):
     """Tests for `DirectServeJsonResource` cancellation."""
 
     def setUp(self) -> None:
-        reactor, clock = get_clock()
-        self.reactor = reactor
-        self.resource = CancellableDirectServeJsonResource(clock)
+        self.reactor = ThreadedMemoryReactorClock()
+        self.clock = Clock(self.reactor)
+        self.resource = CancellableDirectServeJsonResource(self.clock)
         self.site = FakeSite(self.resource, self.reactor)
 
     def test_cancellable_disconnect(self) -> None:
@@ -503,9 +496,9 @@ class DirectServeHtmlResourceCancellationTests(unittest.TestCase):
     """Tests for `DirectServeHtmlResource` cancellation."""
 
     def setUp(self) -> None:
-        reactor, clock = get_clock()
-        self.reactor = reactor
-        self.resource = CancellableDirectServeHtmlResource(clock)
+        self.reactor = ThreadedMemoryReactorClock()
+        self.clock = Clock(self.reactor)
+        self.resource = CancellableDirectServeHtmlResource(self.clock)
         self.site = FakeSite(self.resource, self.reactor)
 
     def test_cancellable_disconnect(self) -> None: