Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 5ce2887

Browse files
authored
Strengthen tests about deleted old push actions. (#13471)
1 parent 70d3e70 commit 5ce2887

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

changelog.d/13471.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Clean-up tests for notifications.

tests/storage/test_event_push_actions.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,22 @@ def _mark_read(event_id: str) -> None:
135135
_assert_counts(1, 1, 0)
136136

137137
# Delete old event push actions, this should not affect the (summarised) count.
138+
#
139+
# All event push actions are kept for 24 hours, so need to move forward
140+
# in time.
141+
self.pump(60 * 60 * 24)
138142
self.get_success(self.store._remove_old_push_actions_that_have_rotated())
143+
# Double check that the event push actions have been cleared (i.e. that
144+
# any results *must* come from the summary).
145+
result = self.get_success(
146+
self.store.db_pool.simple_select_list(
147+
table="event_push_actions",
148+
keyvalues={"1": 1},
149+
retcols=("event_id",),
150+
desc="",
151+
)
152+
)
153+
self.assertEqual(result, [])
139154
_assert_counts(1, 1, 0)
140155

141156
_mark_read(last_event_id)

0 commit comments

Comments
 (0)