Skip to content

test: expand coverage for src/protocols/http2/frame.cpp #1030

Description

@kcenon

Part of #953

What

Raise coverage of src/protocols/http2/frame.cpp from the pre-Step-1 snapshot level (line 12.9% of ~310 instrumented lines, 2026-04-13 run) to line >= 70% and branch >= 60%, measured under the updated coverage workflow (all BUILD_WITH_* flags, lcov --rc lcov_branch_coverage=1).

Re-measurement required at start of work. Numbers above are from the pre-Step-1 baseline (2026-04-13), captured before the coverage workflow was updated in #986, #987, #989. The current value on develop may differ. Run the coverage workflow (or local lcov) against HEAD before designing tests, and record the current baseline in the first comment on this issue.

Why

  • src/protocols/http2/frame.cpp sits among the lowest-coverage files in the network_system source tree per the Expand unit test coverage from 40% to 80% #953 audit.
  • The uncovered region concentrates in error and boundary paths — exactly the surfaces that regress during the ongoing Result<T> migration and API stabilization.
  • Bringing this file over the 70% line / 60% branch bar is a direct contribution to the Expand unit test coverage from 40% to 80% #953 acceptance criteria (80% line / 70% branch ecosystem-wide).

Where

How

Approach

  1. Re-measure current coverage for this file against develop HEAD and record in an issue comment before writing tests.
  2. Identify the uncovered branches and error paths using the lcov branch report.
  3. Add unit tests that exercise:
    • Frame type/flags/length field boundaries, padding handling, END_STREAM/END_HEADERS interactions, CONTINUATION chains, invalid stream IDs
  4. Keep tests hermetic — no network, no filesystem, no sleeps beyond a few ms for timer-driven code paths.
  5. Run ASAN/TSAN/UBSAN locally (or rely on CI) before requesting review.

Acceptance Criteria

  • Current-baseline coverage for src/protocols/http2/frame.cpp recorded as an issue comment
  • src/protocols/http2/frame.cpp line coverage >= 70% on develop after merge
  • src/protocols/http2/frame.cpp branch coverage >= 60% on develop after merge
  • All tests pass on Ubuntu/macOS/Windows CI
  • ASAN, TSAN, UBSAN sanitizer jobs green
  • No regressions in overall network_system coverage

Out of Scope

  • Refactoring src/protocols/http2/frame.cpp beyond what is strictly needed to make paths testable (seam insertion is acceptable; behavior changes are not).
  • Integration or end-to-end tests — those live in separate files and are tracked elsewhere.
  • Sibling files listed in Expand unit test coverage from 40% to 80% #953 — each gets its own sub-issue.

Dependencies

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions