Skip to content

Add unit tests for AsyncLogWriter (#2497). Principle I.#2760

Merged
ten9876 merged 1 commit into
mainfrom
aetherclaude/issue-2497
May 16, 2026
Merged

Add unit tests for AsyncLogWriter (#2497). Principle I.#2760
ten9876 merged 1 commit into
mainfrom
aetherclaude/issue-2497

Conversation

@aethersdr-agent

Copy link
Copy Markdown
Contributor

Summary

Fixes #2497

What was changed

Add unit tests for AsyncLogWriter (#2497). Principle I.

Files modified

  • CMakeLists.txt
  • tests/async_log_writer_test.cpp
 CMakeLists.txt                  |  11 ++
 tests/async_log_writer_test.cpp | 341 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 352 insertions(+)

Generated by AetherClaude (automated agent for AetherSDR)

Pins down the public-API behavior of AsyncLogWriter so future tightening
of the PII redaction regexes (#2478) cannot regress without a test
failing. Cases mirror the suggested set in the issue:

- Line shape preservation ([HH:mm:ss.zzz] LVL cat: msg\n) for every
  QtMsgType label
- IPv4 redaction, ver= exemption, and lock-in that quoted four-octet
  IPs are still redacted (per triage: quoting is not authentication of
  intent). The original "0.9.8" case was dropped as non-applicable
  (three octets never match the regex) and replaced with the explicit
  three-octet pass-through assertion.
- Radio serial, id_token, MAC dash, and MAC colon redaction
- clearLog truncates pre-clear lines and preserves post-clear lines
- shutdown drains the queue (no loss on graceful stop)
- Drop accounting under burst load (asserts inequalities since the
  worker drains concurrently; per triage open-question #2)
- High-priority reserve keeps a critical line alive under a debug
  burst, and droppedHighPriorityLines stays at 0
- Stderr mirroring matches the file contents byte-for-byte when
  mirrorToStderr=true

Test uses only the public API (no test-only hooks added to
AsyncLogWriter), and routes the log path through QTemporaryDir so the
suite does not litter /tmp.

Blast radius: risk_score=0.000, 0 high-risk affected (AsyncLogWriter
itself has self_betweenness=0; pure additive test + CMakeLists entry).
@aethersdr-agent aethersdr-agent Bot requested a review from ten9876 as a code owner May 16, 2026 22:02
@aethersdr-agent aethersdr-agent Bot enabled auto-merge (squash) May 16, 2026 22:02
@ten9876 ten9876 merged commit b5a74d1 into main May 16, 2026
5 checks passed
@ten9876 ten9876 deleted the aetherclaude/issue-2497 branch May 16, 2026 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unit tests for AsyncLogWriter

1 participant