mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-09-27 04:30:50 -04:00
Make max_delta equal to period * 10%
This commit is contained in:
parent
7e1c7cc274
commit
847b9dcd1c
3 changed files with 8 additions and 32 deletions
|
@ -436,7 +436,7 @@ class AccountValidityBackgroundJobTestCase(unittest.HomeserverTestCase):
|
|||
|
||||
def make_homeserver(self, reactor, clock):
|
||||
self.validity_period = 10
|
||||
self.max_delta = 10
|
||||
self.max_delta = self.validity_period * 10. / 100.
|
||||
|
||||
config = self.default_config()
|
||||
|
||||
|
@ -453,22 +453,6 @@ class AccountValidityBackgroundJobTestCase(unittest.HomeserverTestCase):
|
|||
return self.hs
|
||||
|
||||
def test_background_job(self):
|
||||
"""
|
||||
Tests whether the account validity startup background job does the right thing,
|
||||
which is sticking an expiration date to every account that doesn't already have
|
||||
one.
|
||||
"""
|
||||
user_id = self.register_user("kermit", "user")
|
||||
|
||||
self.hs.config.account_validity.startup_job_max_delta = 0
|
||||
|
||||
now_ms = self.hs.clock.time_msec()
|
||||
self.get_success(self.store._set_expiration_date_when_missing())
|
||||
|
||||
res = self.get_success(self.store.get_expiration_ts_for_user(user_id))
|
||||
self.assertEqual(res, now_ms + self.validity_period)
|
||||
|
||||
def test_background_job_with_max_delta(self):
|
||||
"""
|
||||
Tests the same thing as test_background_job, except that it sets the
|
||||
startup_job_max_delta parameter and checks that the expiration date is within the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue