test(quic): expand experimental/quic_server.cpp coverage#1073
Merged
Conversation
Append 38 focused unit tests to tests/test_messaging_quic_server.cpp that exercise reachable surface in src/experimental/quic_server.cpp without an active QUIC client. Categories: - Constructor variations (empty, long, special-char, string_view ids) - Server-not-running guard paths (counters, sessions list, get_session) - i_quic_server interface alias methods (start/stop) and callback setters - Configuration boundary values (zero, uint64 max, large alpn list) - Multi-instance state isolation (independent ids and run states) - Broadcast/multicast no-session edge cases (empty, large, unknown ids) - Disconnect edge cases (custom error code, non-zero broadcast code) - Restart lifecycle (stop then start again, server_id stability) - quic_connection_stats accumulators and RTT fields These do not reach the >=80% line / >=70% branch acceptance criteria of #1066. Closing the gap requires an in-process QUIC loopback fixture covering accept-loop, handshake, and per-connection error fan-out that does not exist in the test tree today. This PR therefore uses "Part of #1066" rather than "Closes" and the issue stays open. Part of #1066 Part of #953
Contributor
Coverage Report
Coverage DetailsFull HTML report is available as a build artifact. |
This was referenced Apr 27, 2026
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.
What
Append 38 focused unit tests to
tests/test_messaging_quic_server.cppthat exercise reachable surface insrc/experimental/quic_server.cppwithout an active QUIC client.Change Type
Affected Components
tests/test_messaging_quic_server.cpp— +489 LOC, +38 test cases (no source/build changes)Why
Part of #1066(and the parent epicPart of #953) — narrow test-expansion across worst-coverage protocol files.Pre-PR baseline (2026-04-26 lcov):
experimental/quic_server.cpp43.7% line / 17.5% branch — priority #5 in the 2026-04-26 re-measurement. Existing tests cover the basic lifecycle and config; this PR fills in surface that does not require an active QUIC peer (input variations, callback wiring, struct boundary values, multi-instance state isolation).Where
string_viewidsconnection_count,sessions,get_session,disconnect_alli_quic_serverinterface aliasesstart,stop(alias methods)uint64::maxtimeouts, big alpn list, retry-key, copy/optionalquic_connection_statsedgesHow
Implementation Approach
tests/test_messaging_quic_server.cpp(no parallel suite)MessagingQuicServerTestGTest fixture<cstdint>,<future>,<limits>,<string>,<vector>to test-file includesCoverage Scope (Honest Assessment)
This PR does not reach the
>=80% line / >=70% branchacceptance criteria of #1066. The remaining gap is concentrated in the accept-loop / packet-handling code (start_receive,handle_packet,find_or_create_session) and in the per-connection error-fan-out path. Those paths require an in-process QUIC loopback fixture (UDP socket pair, version-negotiation, retry-token validation) that does not currently exist in the test tree.Building the loopback fixture is a larger, separate piece of work and is tracked under #953. This PR therefore uses
Part of #1066rather thanCloses #1066and the issue stays open.Test Plan
Breaking Changes
None — test-only addition.
Rollback Plan
Revert this single commit; no schema, ABI, or build surface affected.
Part of #1066
Part of #953