From 4315328f2be47e94e5b473e786e54ff82da1e1bf Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Sun, 26 Jul 2026 14:24:44 +0000 Subject: [PATCH] Stop the log analyzer double-counting outbound peer promotions The shared analyzer matched two strings for one event: "Peer promoted to active", emitted at info, and "Outbound handshake completed", emitted at debug. Both come from handle_msg2 on the same call path for the same outbound promotion, so any run at debug level counted every outbound promotion twice. Measured rather than argued. On the archived debug-level churn-mixed run of 2026-07-25, the node logs carry 20 of each string; the old matcher reported 40 promotions and the new one reports 20. The neighbouring counters are unmoved at 13 sessions and 33 parent switches. Info-level runs are unaffected, which was checked rather than assumed: on the tcp-mesh run of the same date the debug string occurs zero times, and the old and new matchers both report 7 against 7 raw occurrences. Three scenarios run at debug, one of them gating, so this corrects the promotion figure in their artifacts. No assertion reads the counter, so no suite's verdict changes. The earlier fix that introduced this added the live string alongside the dead one where it needed to replace it. --- testing/lib/log_analysis.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/testing/lib/log_analysis.py b/testing/lib/log_analysis.py index 7de162f..27039cf 100644 --- a/testing/lib/log_analysis.py +++ b/testing/lib/log_analysis.py @@ -148,8 +148,11 @@ def _analyze_lines(result: AnalysisResult, source: str, log_text: str): # Session establishment if "Session established" in line: result.sessions_established.append((source, line)) - # Peer promotion - if "Peer promoted to active" in line or "Outbound handshake completed" in line: + # Peer promotion. Match only the info-level string. "Outbound handshake + # completed" is emitted from handle_msg2 on the same call path for the + # same promotion, so matching it too double-counted every outbound + # promotion in any run at debug level. + if "Peer promoted to active" in line: result.peers_promoted.append((source, line)) # Peer removal if "Peer removed" in line: