diff options
author | Mathieu Velten <mathieuv@matrix.org> | 2023-06-21 10:41:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-21 10:41:11 +0200 |
commit | 496f73103df838795b0e98f8c1c7337468e41abc (patch) | |
tree | ec6d75dbb2b449420ffc5cbde0591c76fefc166c /tests/http | |
parent | Merge branch 'master' into develop (diff) | |
download | synapse-496f73103df838795b0e98f8c1c7337468e41abc.tar.xz |
Allow for the configuration of max request retries and min/max retry delays in the matrix federation client (#15783)
Diffstat (limited to 'tests/http')
-rw-r--r-- | tests/http/test_matrixfederationclient.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/http/test_matrixfederationclient.py b/tests/http/test_matrixfederationclient.py index 0dfc03ce50..b5f4a60fe5 100644 --- a/tests/http/test_matrixfederationclient.py +++ b/tests/http/test_matrixfederationclient.py @@ -40,7 +40,7 @@ from synapse.server import HomeServer from synapse.util import Clock from tests.server import FakeTransport -from tests.unittest import HomeserverTestCase +from tests.unittest import HomeserverTestCase, override_config def check_logcontext(context: LoggingContextOrSentinel) -> None: @@ -640,3 +640,21 @@ class FederationClientTests(HomeserverTestCase): self.cl.build_auth_headers( b"", b"GET", b"https://example.com", destination_is=b"" ) + + @override_config( + { + "federation": { + "client_timeout": "180s", + "max_long_retry_delay": "100s", + "max_short_retry_delay": "7s", + "max_long_retries": 20, + "max_short_retries": 5, + } + } + ) + def test_configurable_retry_and_delay_values(self) -> None: + self.assertEqual(self.cl.default_timeout_seconds, 180) + self.assertEqual(self.cl.max_long_retry_delay_seconds, 100) + self.assertEqual(self.cl.max_short_retry_delay_seconds, 7) + self.assertEqual(self.cl.max_long_retries, 20) + self.assertEqual(self.cl.max_short_retries, 5) |