diff options
author | Erik Johnston <erikj@element.io> | 2024-05-18 12:03:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-18 12:03:30 +0100 |
commit | 52af16c56175160512420d8654ac558a1e5af541 (patch) | |
tree | 7c9a9e4dbae6265ebff3cb08809a6fbac7fcbfc6 /tests/unittest.py | |
parent | Federated Knocking Endpoints added (missing in Docu) (#17058) (diff) | |
download | synapse-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 'tests/unittest.py')
-rw-r--r-- | tests/unittest.py | 4 |
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: |