What
Round 2 of protocols/grpc/client.cpp test coverage expansion using the Phase 2 substrate (frame_injector + mock_grpc_server_peer) merged in PR #1105 (Part of #1074). Round 1 sub-issues #994 and #1063 closed but the file still stands at 22.6% line / 9.5% branch in the 2026-05-06 coverage measurement (run 25430202846).
Why
grpc/client.cpp is the second-largest single-file contributor to the #953 coverage gap:
- Line gap: 482 LOC * (60% - 22.6%) = ~180 additional hit lines
- Branch gap: 926 branches * (35% - 9.5%) = ~236 additional hit branches
Phase 2 substrate (#1074) provides a mock_grpc_server_peer whose per-frame writes are routed through frame_injector, enabling deterministic error-path coverage on the gRPC client.
Where
| Path |
Role |
src/protocols/grpc/client.cpp |
File under test (482 LOC, 926 branches) |
tests/unit/grpc_client_branch_test.cpp |
Add new TEST_F cases |
tests/support/mock_grpc_server_peer.h |
Phase 2B/2E substrate |
tests/support/frame_injector.h |
Phase 2E fault-injection hook |
How
Acceptance criteria
Test plan for reviewers
cmake --build build --target network_grpc_client_branch_test -j 4
./build/bin/network_grpc_client_branch_test
# Expect: all TEST_F PASS
Out of scope
- gRPC frame parsing (
protocols/grpc/frame.cpp already at 95.8%)
- gRPC server (
protocols/grpc/server.cpp already at 85.4%)
- Service registry (
protocols/grpc/service_registry.cpp already at 84.3%)
Related
What
Round 2 of
protocols/grpc/client.cpptest coverage expansion using the Phase 2 substrate (frame_injector+mock_grpc_server_peer) merged in PR #1105 (Part of #1074). Round 1 sub-issues #994 and #1063 closed but the file still stands at 22.6% line / 9.5% branch in the 2026-05-06 coverage measurement (run 25430202846).Why
grpc/client.cppis the second-largest single-file contributor to the #953 coverage gap:Phase 2 substrate (#1074) provides a
mock_grpc_server_peerwhose per-frame writes are routed throughframe_injector, enabling deterministic error-path coverage on the gRPC client.Where
src/protocols/grpc/client.cpptests/unit/grpc_client_branch_test.cpptests/support/mock_grpc_server_peer.htests/support/frame_injector.hHow
Acceptance criteria
grpc/client.cppline coverage >= 60.0% (current 22.6%, +37.4pp)grpc/client.cppbranch coverage >= 35.0% (current 9.5%, +25.5pp)frame_injector:injection_mode::dropon 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_grpc_client_branch_test -j 4 ./build/bin/network_grpc_client_branch_test # Expect: all TEST_F PASSOut of scope
protocols/grpc/frame.cppalready at 95.8%)protocols/grpc/server.cppalready at 85.4%)protocols/grpc/service_registry.cppalready at 84.3%)Related