From 3ddefd24e0a0b612fe740cf06eb1003c456a16ff Mon Sep 17 00:00:00 2001 From: maurane Date: Wed, 23 Sep 2026 16:07:09 +0200 Subject: [PATCH] =?UTF-8?q?fix(classifier):=20=F0=9F=9A=91=EF=B8=8F=20fix?= =?UTF-8?q?=20classifying=20criteria?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit two log entries that are consecutive and do have different error message are two different errors. --- src/logwatcher/classifier.py | 2 +- tests/test_classifier.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/logwatcher/classifier.py b/src/logwatcher/classifier.py index 2be060d..315f9bd 100644 --- a/src/logwatcher/classifier.py +++ b/src/logwatcher/classifier.py @@ -66,7 +66,7 @@ def _is_duplicate_error(previous: LogEntry, current: LogEntry) -> bool: and previous.mdc_server_name == current.mdc_server_name and previous.store_name == current.store_name and previous.start_time == current.start_time - and _error_identity(previous) == _error_identity(current) + and previous.error_message == current.error_message ) diff --git a/tests/test_classifier.py b/tests/test_classifier.py index 8bf6852..b96e00e 100644 --- a/tests/test_classifier.py +++ b/tests/test_classifier.py @@ -158,7 +158,7 @@ def test_classify_log_entries_merges_consecutive_duplicates(): def test_classify_log_entries_merges_same_error_name(): - """Same error code with a different amount is still a single log entry.""" + """Same error code with a different amount is two different entries.""" log_entries = parse_lines( [ _build_log_line( @@ -172,7 +172,7 @@ def test_classify_log_entries_merges_same_error_name(): relevant, _ = classify_log_entries(log_entries) - assert len(relevant) == 1 + assert len(relevant) == 2 def test_classify_log_entries_keeps_duplicates_from_other_store_or_scan():