From f37a578136f0ee0002ee8890ade6559ebd8600ea Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Mon, 19 Oct 2026 06:27:23 -0400 Subject: [PATCH] test(syslog): a preset's 15-minute window doesn't reach the 40-minute-old nfsd line (#6001) Co-Authored-By: Claude Opus 5.5 --- tests/integration/test_syslog.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/integration/test_syslog.py b/tests/integration/test_syslog.py index cd67cc8..e52d039 100644 --- a/tests/integration/test_syslog.py +++ b/tests/integration/test_syslog.py @@ -332,6 +332,7 @@ def test_patterns_page_adds_edits_and_removes_and_a_rename_moves_counts(app): assert rows["nfs"].phrases[0] == "nfsd:" await patterns.record_counts(app, now) + assert await _latest(app, "lines_matching_nfs") == {src_name: 0.0} page = await (await admin.get("/plugins/syslog/patterns")).get_data(as_text=True) assert "Quota full" in page and "NFS server trouble" in page assert "metric_name=lines_matching_quota_full" in page @@ -353,7 +354,9 @@ def test_patterns_page_adds_edits_and_removes_and_a_rename_moves_counts(app): renamed = await admin.post(f"/plugins/syslog/sources/{src_id}/edit", headers=csrf, form={"name": "Big NAS", "host_id": ""}) assert renamed.status_code == 302 - assert await _latest(app, "lines_matching_nfs") == {"Big NAS": 1.0} + # (0: a preset's window is 15 minutes, and the nfsd line is 40 old; + # no count has run since, so the row under the new name was moved.) + assert await _latest(app, "lines_matching_nfs") == {"Big NAS": 0.0} removed = await admin.post(f"/plugins/syslog/patterns/{rows['nfs'].id}/delete", headers=csrf) assert removed.status_code == 302