diff options
author | Mathieu Velten <mathieuv@matrix.org> | 2023-06-09 15:26:08 +0200 |
---|---|---|
committer | Mathieu Velten <mathieuv@matrix.org> | 2023-06-09 15:26:08 +0200 |
commit | 0020b333f9e4e3fd5c991a87199d26491af2f5ad (patch) | |
tree | 5065b955980f616696a2da2db0768f6a74328167 /tests/rest/admin/test_room.py | |
parent | rename var (diff) | |
download | synapse-0020b333f9e4e3fd5c991a87199d26491af2f5ad.tar.xz |
comments
Diffstat (limited to '')
-rw-r--r-- | tests/rest/admin/test_room.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/rest/admin/test_room.py b/tests/rest/admin/test_room.py index 4b93edae7e..e074a1df9d 100644 --- a/tests/rest/admin/test_room.py +++ b/tests/rest/admin/test_room.py @@ -36,6 +36,9 @@ from tests import unittest """Tests admin REST events for /rooms paths.""" +ONE_HOUR_IN_S = 3600 + + class DeleteRoomTestCase(unittest.HomeserverTestCase): servlets = [ synapse.rest.admin.register_servlets, @@ -995,7 +998,8 @@ class DeleteRoomV2TestCase(unittest.HomeserverTestCase): with self.assertRaises(AssertionError): self._is_purged(room_id) - self.reactor.advance(3600 * 24) + # Advance 24 hours in the future, past the `purge_retention_period` + self.reactor.advance(24 * ONE_HOUR_IN_S) self._is_purged(room_id) @@ -1019,7 +1023,9 @@ class DeleteRoomV2TestCase(unittest.HomeserverTestCase): with self.assertRaises(AssertionError): self._is_purged(room_id) - self.reactor.advance(3600 * 1) + # Advance one hour in the future past `PURGE_ROOMS_INTERVAL_MS` so that + # the automatic purging takes place and resumes the purge + self.reactor.advance(ONE_HOUR_IN_S) self._is_purged(room_id) @@ -1058,7 +1064,9 @@ class DeleteRoomV2TestCase(unittest.HomeserverTestCase): with self.assertRaises(AssertionError): self._is_purged(room_id) - self.reactor.advance(3600 * 1) + # Advance one hour in the future past `PURGE_ROOMS_INTERVAL_MS` so that + # the automatic purging takes place and resumes the purge + self.reactor.advance(ONE_HOUR_IN_S) # Test that all users has been kicked (room is shutdown) self._has_no_members(room_id) |