Skip to content

test(quic): expand experimental/quic_server.cpp coverage#1073

Merged
kcenon merged 1 commit into
developfrom
test/issue-1066-quic-server-coverage
Apr 27, 2026
Merged

test(quic): expand experimental/quic_server.cpp coverage#1073
kcenon merged 1 commit into
developfrom
test/issue-1066-quic-server-coverage

Conversation

@kcenon

@kcenon kcenon commented Apr 27, 2026

Copy link
Copy Markdown
Owner

What

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.

Change Type

  • Test (no production behavior change)

Affected Components

  • tests/test_messaging_quic_server.cpp — +489 LOC, +38 test cases (no source/build changes)

Why

Part of #1066 (and the parent epic Part of #953) — narrow test-expansion across worst-coverage protocol files.

Pre-PR baseline (2026-04-26 lcov): experimental/quic_server.cpp 43.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

Test category Tests added Targets
Constructor variations 4 empty / long / special-char / string_view ids
Server-not-running guard paths 5 connection_count, sessions, get_session, disconnect_all
i_quic_server interface aliases 2 start, stop (alias methods)
Interface callback setters 7 i_quic_server callbacks + null-callback safety + null-legacy safety
Configuration boundary values 7 zero / uint64::max timeouts, big alpn list, retry-key, copy/optional
Multi-instance state isolation 3 independent ids / run states / 50 servers constructable
Broadcast / multicast (no sessions) 4 empty data, empty id list, unknown ids, 64 KB payload
Disconnect edge cases 2 custom error code, non-zero broadcast code
Restart lifecycle 2 restart after stop, server_id stability
quic_connection_stats edges 2 accumulators, RTT fields

How

Implementation Approach

  • Append tests to existing tests/test_messaging_quic_server.cpp (no parallel suite)
  • Reuse the existing MessagingQuicServerTest GTest fixture
  • Add only <cstdint>, <future>, <limits>, <string>, <vector> to test-file includes
  • No changes to production source, build files, or CMake

Coverage Scope (Honest Assessment)

This PR does not reach the >=80% line / >=70% branch acceptance 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 #1066 rather than Closes #1066 and 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

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
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

Metric Value
Line Coverage 66.7%
Branch Coverage 33.0%
Target 80% lines / 70% branches
Coverage Details

Full HTML report is available as a build artifact.

@kcenon kcenon merged commit bc78ddc into develop Apr 27, 2026
9 checks passed
@kcenon kcenon deleted the test/issue-1066-quic-server-coverage branch April 27, 2026 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants