Skip to content

test(http2): expand http2_client.cpp coverage to 70%/50% #1119

Description

@kcenon

What

Expand unit test coverage for protocols/http2/http2_client.cpp from current 18.8% line / 9.9% branch to >=70% line / >=50% branch. Existing tests cover happy paths only — error paths, branch combinations, and boundary cases are largely untested.

Part of #953.

Why

Where

  • Source: protocols/http2/http2_client.cpp (576 LOC)
  • Tests: tests/unit/protocols/http2/

How

Approach

  1. Audit existing http2_client tests via lcov --branch-coverage to identify uncovered branches.
  2. Add tests for error paths: connection refused, TLS handshake failure, HTTP/2 GOAWAY, RST_STREAM scenarios.
  3. Add tests for boundary cases: max stream IDs, large frame payloads, fragmented headers, flow-control window exhaustion.
  4. Add tests for protocol violations: malformed frames, invalid stream states, unexpected frame sequences.
  5. Re-run coverage workflow to verify >=70% line and >=50% branch achieved.

Acceptance Criteria

  • protocols/http2/http2_client.cpp line coverage >= 70%
  • protocols/http2/http2_client.cpp branch coverage >= 50%
  • All new tests pass on Ubuntu/macOS/Windows CI
  • All sanitizer builds (ASAN, TSAN, UBSAN) pass
  • Coverage workflow re-measurement attached as a comment on this issue

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions