diff options
author | Erik Johnston <erik@matrix.org> | 2021-05-21 17:57:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-21 17:57:08 +0100 |
commit | 3e831f24ffc887e174f67ff7b1cfe3a429b7b5c1 (patch) | |
tree | ef58fff9a3c71f57b995790b3e36e6c84fff83f1 /tests/util/test_retryutils.py | |
parent | Fix /upload 500'ing when presented a very large image (#10029) (diff) | |
download | synapse-3e831f24ffc887e174f67ff7b1cfe3a429b7b5c1.tar.xz |
Don't hammer the database for destination retry timings every ~5mins (#10036)
Diffstat (limited to '')
-rw-r--r-- | tests/util/test_retryutils.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/tests/util/test_retryutils.py b/tests/util/test_retryutils.py index 9b2be83a43..9e1bebdc83 100644 --- a/tests/util/test_retryutils.py +++ b/tests/util/test_retryutils.py @@ -51,10 +51,12 @@ class RetryLimiterTestCase(HomeserverTestCase): except AssertionError: pass + self.pump() + new_timings = self.get_success(store.get_destination_retry_timings("test_dest")) - self.assertEqual(new_timings["failure_ts"], failure_ts) - self.assertEqual(new_timings["retry_last_ts"], failure_ts) - self.assertEqual(new_timings["retry_interval"], MIN_RETRY_INTERVAL) + self.assertEqual(new_timings.failure_ts, failure_ts) + self.assertEqual(new_timings.retry_last_ts, failure_ts) + self.assertEqual(new_timings.retry_interval, MIN_RETRY_INTERVAL) # now if we try again we should get a failure self.get_failure( @@ -77,14 +79,16 @@ class RetryLimiterTestCase(HomeserverTestCase): except AssertionError: pass + self.pump() + new_timings = self.get_success(store.get_destination_retry_timings("test_dest")) - self.assertEqual(new_timings["failure_ts"], failure_ts) - self.assertEqual(new_timings["retry_last_ts"], retry_ts) + self.assertEqual(new_timings.failure_ts, failure_ts) + self.assertEqual(new_timings.retry_last_ts, retry_ts) self.assertGreaterEqual( - new_timings["retry_interval"], MIN_RETRY_INTERVAL * RETRY_MULTIPLIER * 0.5 + new_timings.retry_interval, MIN_RETRY_INTERVAL * RETRY_MULTIPLIER * 0.5 ) self.assertLessEqual( - new_timings["retry_interval"], MIN_RETRY_INTERVAL * RETRY_MULTIPLIER * 2.0 + new_timings.retry_interval, MIN_RETRY_INTERVAL * RETRY_MULTIPLIER * 2.0 ) # |