Skip to content

tests(event_poller): cover start()'s fatal-guard; document rest as tooling noise - #105

Merged
Yaraslaut merged 1 commit into
masterfrom
investigate/test-event-poller-coverage
Aug 16, 2026
Merged

tests(event_poller): cover start()'s fatal-guard; document rest as tooling noise#105
Yaraslaut merged 1 commit into
masterfrom
investigate/test-event-poller-coverage

Conversation

@Yaraslaut

Copy link
Copy Markdown
Member

Investigated examples/common/testkit/test_event_poller.cpp -- the single
largest remaining coverage gap in the codebase (80 gap-units, 72.41%
covered). Verdict: almost entirely tooling noise, with one real gap.

The 14 pure-miss lines: tooling noise

Every one is a defensive/invariant-proving statement that must never
execute for its own test to pass:

  • Several are FAIL("... must not run ...") bodies inside onEvent/
    onFatalError lambdas -- their entire purpose is proving the Poller
    correctly suppresses these callbacks in that scenario.
  • A few are the "other half" of a dispatch closure (both .then() and
    .onError() wired, mirroring production's shape) where each test's
    fixture only forces one arm -- the other arm is exercised by a
    sibling test's scenario, just not within the same closure
    instantiation. Per-line coverage artifact, not a missing behavior.

The ~66 partial branches: also noise (sampled, not exhaustive)

Catch2 macro-expansion branches (the large majority), a ternary whose
both arms are exercised in aggregate across the file (just not per
closure), and defensive invariant conditionals proving a double-report
bug can't happen.

One genuine gap, closed

start()/stop() (the pause/resume pair a hidden poll view uses, per
event_poller.hpp's own doc comments) were never called directly by
anything in this file -- every other test only exercises the timer
indirectly. start()'s only branch (if (!_fatal)) had never run
either arm. Added one test covering both: start() rearms a merely-
stopped timer, but refuses once a genuinely fatal error has stopped it
for good (only resume() can undo that).

Verification

ladder_common_tests filtered to [event-poller]: 11 test cases,
72 assertions, all passing
(10 cases before this change).

@codecov

codecov Bot commented Aug 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Yaraslaut
Yaraslaut force-pushed the investigate/test-event-poller-coverage branch from 0dfc37d to f3304cf Compare August 16, 2026 07:06
…ublic method

Every other test in this file only exercises the timer indirectly
(the constructor's own _timer.start(interval), handleError's
_timer.stop(), resume()'s own _timer.start()) -- start()/stop() (the
pause/resume pair a hidden poll view uses, per event_poller.hpp's own
doc comments) were never called directly by anything, so start()'s
only branch (`if (!_fatal)`) never ran either arm.

The other 79 flagged gap-units in this file (14 pure misses, ~66
partials) are confirmed tooling noise, not real gaps: every pure-miss
line is either a FAIL("... must not run ...") body inside an
onEvent/onFatalError lambda (whose entire purpose is to prove a
scenario the test's own passing run already disproves), or the
"other half" of a dispatch closure a sibling test's own scenario
exercises instead of this one. The partials sampled are Catch2
macro-expansion branches, a ternary whose both arms are exercised
across the file in aggregate just not within one closure instantiation,
or defensive invariant conditionals proving a double-report bug can't
happen -- none are real EventPoller-class gaps.
@Yaraslaut
Yaraslaut force-pushed the investigate/test-event-poller-coverage branch from f3304cf to 5dbd871 Compare August 16, 2026 07:52
@Yaraslaut
Yaraslaut merged commit 88befca into master Aug 16, 2026
24 checks passed
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.

1 participant