diff --git a/tests/test_ceph.py b/tests/test_ceph.py index 30c2eab..624271b 100644 --- a/tests/test_ceph.py +++ b/tests/test_ceph.py @@ -281,7 +281,10 @@ def test_a_known_condition_matches_a_flag_by_its_name(): e.process([f], T0) acts = e.process([f], T0 + 120) assert [(a.kind, a.payload.get('ticket_id')) for a in acts] == [('known_note', '693930698')] - assert e.incidents['cluster:ceph_flag:noout'].summary.startswith('Ceph flag noout set since ') + assert e.incidents['cluster:ceph_flag:noout'].summary.startswith('Ceph flag noout set since 20') + f.facts['run_start_open'] = True + e.process([f], T0 + 240) + assert e.incidents['cluster:ceph_flag:noout'].summary.startswith('Ceph flag noout set since before 20') def test_ticket_text_says_when_the_start_is_only_a_lower_bound(): diff --git a/thor/checks/ceph.py b/thor/checks/ceph.py index 5e5c87a..67ee3fa 100644 --- a/thor/checks/ceph.py +++ b/thor/checks/ceph.py @@ -392,7 +392,9 @@ class CephCheck: # Stable text: a summary that changes every cycle would re-send the ticket every 30 min. from ..ticket_text import utc since = utc(inc.facts.get('run_start', inc.first_seen))[:16] + ' UTC' - return f'Ceph flag {inc.facts.get("flag")} set since {since}' + # Set since before Thor's 24 h of flag history: the date is only a lower bound. + word = 'before ' if inc.facts.get('run_start_open') else '' + return f'Ceph flag {inc.facts.get("flag")} set since {word}{since}' return inc.summary @staticmethod