Conversation
Round 2 of grpc/client.cpp coverage expansion using the Phase 2 substrate (frame_injector + mock_grpc_server_peer) merged in PR #1105. Round 1 sub-issues #994/#1063 raised happy-path coverage but client.cpp remained at 22.6% line / 9.5% branch on run 25430202846 because error branches require malformed/dropped/truncated/slow byte streams. New TEST_F cases (all gRPC analogues of #1106 http2_client patterns): - DropFirstServerSettingsLeavesGrpcClientUnconnected injection_mode::drop on server SETTINGS strands the underlying h2 handshake; grpc_client::is_connected() never flips true. - MalformedServerSettingsAckTypeByteBlocksGrpcConnect injection_mode::malform with offset 3 / xor 0x0F flips frame type byte (0x04 -> 0x0B) so the client drops the unknown frame and cannot complete the SETTINGS exchange. - TruncatedServerSettingsHeaderBlocksGrpcConnect injection_mode::truncate with truncate_at=4 leaves a partial 9-byte HTTP/2 frame header on the wire, driving the partial-read branch in the underlying http2_client. - NonOkGrpcStatusTrailerDispatchesGrpcErrorBranch new grpc_reply_mode::echo_unary_error_status emits the same HEADERS+DATA reply as echo_unary but the trailing HEADERS frame carries grpc-status: 14 (UNAVAILABLE) and a grpc-message entry, driving the grpc_status != ok dispatch in call_raw. - TruncateAtNineDropsResponsePayloadFailingCallRaw injection_mode::truncate with truncate_at=9 is a no-op for the 9-byte SETTINGS frames so the handshake completes, but the longer response HEADERS / DATA / trailers frames lose their payloads; call_raw resolves with an error. - SlowWriteServerFramesStillCompleteHandshake (gated outside coverage build) drives the partial-read accumulator branch by pacing the server SETTINGS write byte-by-byte. Substrate addition (tests/support only): grpc_reply_mode::echo_unary_error_status — emits trailers with grpc-status: 14 + grpc-message: peer-unavailable. Pure test-support extension; no production source files modified. Acceptance: 5+ TEST_F cases covering the issue's required injection modes (drop/malform/truncate/non-OK trailer/slow_write). Part of #953 Closes #1107
Contributor
Coverage Report
Coverage DetailsFull HTML report is available as a build artifact. |
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1107
Summary
Round 2 of grpc/client.cpp coverage expansion using the Phase 2 substrate (frame_injector + mock_grpc_server_peer) merged in PR #1105. Round 1 sub-issues #994 / #1063 raised happy-path public-API coverage but client.cpp remained at 22.6% line / 9.5% branch in run 25430202846 because error branches require a peer that emits malformed/dropped/truncated/slow byte streams.
This PR is a direct gRPC analogue of the Round 2 http2 work landed in PR #1117 (Issue #1106).
Acceptance criteria mapping (#1107)
New TEST_F cases
Substrate addition (tests/support only)
grpc_reply_mode::echo_unary_error_status — same HEADERS+DATA framing as echo_unary but the trailing HEADERS frame carries grpc-status: 14 (UNAVAILABLE) and grpc-message: peer-unavailable. Pure test-support extension; no production source files modified.
Test plan
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
Notes
Local toolchain (cmake/g++) was unavailable in the work environment, so build verification is delegated to CI.