What
Round 2 of protocols/http2/http2_client.cpp test coverage expansion using the Phase 2 substrate (frame_injector + mock_h2_server_peer) merged in PR #1105 (Part of #1074). Round 1 sub-issues #991 and #1062 closed but the file still stands at 18.8% line / 9.9% branch in the 2026-05-06 coverage measurement (run 25430202846).
This sub-issue narrows scope to error-branch coverage specifically, leveraging the fault-injection infrastructure that did not exist when Round 1 was opened.
Why
http2_client.cpp is the single largest contributor to the #953 coverage gap:
- Line gap: 576 LOC * (60% - 18.8%) = ~237 additional hit lines
- Branch gap: 979 branches * (40% - 9.9%) = ~295 additional hit branches
Without raising it, the epic cannot meet its acceptance criteria. Phase 2 substrate (#1074) was specifically designed to enable deterministic error-path testing of the HTTP/2 client by giving tests control over server-side frame timing and integrity.
Where
| Path |
Role |
src/protocols/http2/http2_client.cpp |
File under test (576 LOC, 979 branches) |
tests/unit/http2_client_branch_test.cpp |
Add new TEST_F cases |
tests/support/mock_h2_server_peer.h |
Phase 2A/2A.2/2E substrate |
tests/support/frame_injector.h |
Phase 2E fault-injection hook |
How
Acceptance criteria
Test plan for reviewers
cmake --build build --target network_http2_client_branch_test -j 4
./build/bin/network_http2_client_branch_test
# Expect: all TEST_F PASS
Out of scope
- HTTP/2 frame parsing (
protocols/http2/frame.cpp already at 98.4%)
- HPACK (
protocols/http2/hpack.cpp already at 91.3%)
- Performance / load testing
Related
What
Round 2 of
protocols/http2/http2_client.cpptest coverage expansion using the Phase 2 substrate (frame_injector+mock_h2_server_peer) merged in PR #1105 (Part of #1074). Round 1 sub-issues #991 and #1062 closed but the file still stands at 18.8% line / 9.9% branch in the 2026-05-06 coverage measurement (run 25430202846).This sub-issue narrows scope to error-branch coverage specifically, leveraging the fault-injection infrastructure that did not exist when Round 1 was opened.
Why
http2_client.cppis the single largest contributor to the #953 coverage gap:Without raising it, the epic cannot meet its acceptance criteria. Phase 2 substrate (#1074) was specifically designed to enable deterministic error-path testing of the HTTP/2 client by giving tests control over server-side frame timing and integrity.
Where
src/protocols/http2/http2_client.cpptests/unit/http2_client_branch_test.cpptests/support/mock_h2_server_peer.htests/support/frame_injector.hHow
Acceptance criteria
http2_client.cppline coverage >= 60.0% (current 18.8%, +41.2pp)http2_client.cppbranch coverage >= 40.0% (current 9.9%, +30.1pp)frame_injector:injection_mode::dropon first server SETTINGSinjection_mode::malform(flip type byte)injection_mode::truncateinjection_mode::slow_writesrc/changes; test-only PRTest plan for reviewers
cmake --build build --target network_http2_client_branch_test -j 4 ./build/bin/network_http2_client_branch_test # Expect: all TEST_F PASSOut of scope
protocols/http2/frame.cppalready at 98.4%)protocols/http2/hpack.cppalready at 91.3%)Related