summary refs log tree commit diff
path: root/tests/unittest.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@element.io>2024-05-18 12:03:30 +0100
committerGitHub <noreply@github.com>2024-05-18 12:03:30 +0100
commit52af16c56175160512420d8654ac558a1e5af541 (patch)
tree7c9a9e4dbae6265ebff3cb08809a6fbac7fcbfc6 /tests/unittest.py
parentFederated Knocking Endpoints added (missing in Docu) (#17058) (diff)
downloadsynapse-52af16c56175160512420d8654ac558a1e5af541.tar.xz
Add a short sleep if the request is rate-limited (#17210)
This helps prevent clients from "tight-looping" retrying their request.
Diffstat (limited to '')
-rw-r--r--tests/unittest.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/unittest.py b/tests/unittest.py
index e6aad9ed40..18963b9e32 100644
--- a/tests/unittest.py
+++ b/tests/unittest.py
@@ -637,13 +637,13 @@ class HomeserverTestCase(TestCase):
         return self.successResultOf(deferred)
 
     def get_failure(
-        self, d: Awaitable[Any], exc: Type[_ExcType]
+        self, d: Awaitable[Any], exc: Type[_ExcType], by: float = 0.0
     ) -> _TypedFailure[_ExcType]:
         """
         Run a Deferred and get a Failure from it. The failure must be of the type `exc`.
         """
         deferred: Deferred[Any] = ensureDeferred(d)  # type: ignore[arg-type]
-        self.pump()
+        self.pump(by)
         return self.failureResultOf(deferred, exc)
 
     def get_success_or_raise(self, d: Awaitable[TV], by: float = 0.0) -> TV: