Skip to content

test(http2): diagnose 0pp coverage delta after Round 1+2+3 (Part of #1106, #953) #1110

Description

@kcenon

What

After three rounds of expanding tests/unit/http2_client_branch_test.cpp with substrate-driven TEST_F (PR #1108 added 6, PR #1109 added 7 — 13 total), the per-file coverage on src/protocols/http2/http2_client.cpp is still 18.75% line / 9.91% branch (108/576 LH/LF, 97/979 BRH/BRF — byte-identical between b4692fe and d537864). Both Round 2 and Round 3 produced exactly 0pp delta on the production source file. Diagnose this before any further TEST_F work.

Why

Where

Path Role
tests/CMakeLists.txt NETWORK_COVERAGE_BUILD macro definition site — verify scope (target vs per-TEST_F)
tests/unit/http2_client_branch_test.cpp Site of the 13 TEST_F — verify which actually run under coverage
cmake/Coverage.cmake (or equivalent) lcov --remove/--extract filter rules
.github/workflows/code-coverage.yml gcov/lcov pipeline configuration
Run 25464342500 Reference data point (sha d537864)

How

Acceptance criteria

  • Confirm whether the 7 Round-3 dispatcher TEST_F (ServerPingFrameDrivesHandlePingAndKeepsConnectionAlive, ServerPingAckFrameIsAbsorbedSilently, ServerGoawayFrameFlipsConnectionStateToDisconnected, ServerWindowUpdateOnConnectionStreamExpandsWindow, ServerWindowUpdateOnUnknownStreamIsSilentlyIgnored, ServerRstStreamOnUnknownStreamIsSilentlyIgnored, ServerUnknownFrameTypeIsHandledWithoutCrashing) actually executed under coverage instrumentation in run [25464342500] (grep the Run tests step stdout for each TEST_F name).
  • If they did NOT execute, identify which CMake/macro mechanism excluded them (likely NETWORK_COVERAGE_BUILD over-scoping) and submit a fix PR scoped only to the two flaky TEST_F. Re-run coverage workflow on the fix and re-measure.
  • If they DID execute but produced 0pp, run gcov locally against http2_client.cpp.gcda from a baseline-only run and a baseline+new-TEST_F run, diff the resulting .gcov files line-by-line, and document which lines are net-newly-hit (or confirm the empty set).
  • Verify the lcov filter pipeline does not silently drop a second production-source SF for http2_client.cpp (raw coverage.info had 2 SFs; the second is the test file, but confirm no other --remove rule strips a second production compile unit).
  • Output: a one-page diagnostic note in docs/coverage/http2_client_round-4-diagnosis.md (or a comment on this issue) capturing which hypothesis is correct and the proposed fix.

Out of scope

  • Adding more TEST_F (a separate Round 5 sub-issue will be opened only after diagnosis is complete).
  • Changes to src/protocols/http2/http2_client.cpp itself.
  • Cross-file coverage work for other epic-Expand unit test coverage from 40% to 80% #953 contributors.

Hypotheses to investigate (priority order)

  1. CMake NETWORK_COVERAGE_BUILD over-scoping — highest probability, easiest to verify, biggest blast radius. If the macro is set on the test target rather than around the two specific TEST_F, the 7 new dispatcher TEST_F never reach the coverage binary.
  2. Hit-line overlap with baseline ConnectCompletesSettingsExchangeWithMockPeer — medium probability. If true, the new tests are valuable for behavior-correctness but coverage-redundant; a different mock_h2_server_peer mode would be needed to drive truly-uncovered branches.
  3. lcov filter dropping a second production compile unit — low probability after the SF-count check, but a final sanity pass on --remove/--extract rules is cheap.

Test plan for reviewers

After the fix PR (assuming hypothesis 1 lands):

gh run list --repo kcenon/network_system --branch develop --workflow "Code Coverage" --limit 1
# Expect: post-fix run shows http2_client.cpp line/branch coverage moved from 18.75/9.91% upward

Related

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions