summary refs log tree commit diff
path: root/tests/http/federation
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-08-06 16:27:46 +0100
committerErik Johnston <erik@matrix.org>2019-08-06 17:01:23 +0100
commitaf9f1c07646031bf267aa20f2629d5b96c6603b6 (patch)
tree15dccf6f8ce7c589bda29b760d72c56f3de456c3 /tests/http/federation
parentMerge pull request #5825 from matrix-org/erikj/fix_empty_limited_sync (diff)
downloadsynapse-af9f1c07646031bf267aa20f2629d5b96c6603b6.tar.xz
Add a lower bound for TTL on well known results.
It costs both us and the remote server for us to fetch the well known
for every single request we send, so we add a minimum cache period. This
is set to 5m so that we still honour the basic premise of "refetch
frequently".
Diffstat (limited to 'tests/http/federation')
-rw-r--r--tests/http/federation/test_matrix_federation_agent.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/http/federation/test_matrix_federation_agent.py b/tests/http/federation/test_matrix_federation_agent.py
index 4255add097..5e709c0c17 100644
--- a/tests/http/federation/test_matrix_federation_agent.py
+++ b/tests/http/federation/test_matrix_federation_agent.py
@@ -953,7 +953,7 @@ class MatrixFederationAgentTests(TestCase):
         well_known_server = self._handle_well_known_connection(
             client_factory,
             expected_sni=b"testserv",
-            response_headers={b"Cache-Control": b"max-age=10"},
+            response_headers={b"Cache-Control": b"max-age=1000"},
             content=b'{ "m.server": "target-server" }',
         )
 
@@ -969,7 +969,7 @@ class MatrixFederationAgentTests(TestCase):
         self.assertEqual(r, b"target-server")
 
         # expire the cache
-        self.reactor.pump((10.0,))
+        self.reactor.pump((1000.0,))
 
         # now it should connect again
         fetch_d = self.do_get_well_known(b"testserv")