test(tuic): add 0-RTT integration tests for quinn and quiche backends#26
Merged
Conversation
The quinn backend is the default, yet only the quiche backend had 0-RTT coverage. Add a quinn 0-RTT test that relays TCP and UDP through the client's SOCKS5 proxy with `zero_rtt_handshake = true`, exercising the quinn 0-RTT server config path (`max_early_data_size = u32::MAX`) and the `into_0rtt()` accept path. New helpers in tuic-tests/src/lib.rs: - `quinn_server_config` + `start_quinn_pair`, mirroring the quiche pair. - Rename `quiche_client_config` -> `tuic_client_config`; the client is always quinn regardless of the server backend, so it is shared by both pairs. The quinn server helper sets ALPN explicitly: unlike the quiche backend (which forces `h3` internally), the quinn backend passes `tls.alpn` straight through, so an empty list fails ALPN negotiation against the client's `h3`. Like the quiche 0-RTT test, this verifies the 0-RTT-enabled config path handshakes and relays correctly; it does not assert early-data replay on a resumed handshake (the first connection is always 1-RTT). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The quiche 0-RTT test only covered TCP, while the new quinn 0-RTT test covers both TCP and UDP. Add UDP (native datagram mode) relay to the quiche test and rename it to `quiche_zero_rtt_tcp_and_udp_relay` so both backends have symmetric 0-RTT coverage. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
CI runs `cargo +nightly fmt --check` with `wrap_comments`; the doc comments in the new 0-RTT helpers/test exceeded max_width. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Adds symmetric 0-RTT integration test coverage for both QUIC backends of wind-tuic.
quinn backend (new test) —
crates/tuic-tests/tests/quinn_zero_rtt.rs:quinn_zero_rtt_tcp_and_udp_relaystarts a quinn-backed server + client withzero_rtt_handshake = trueand relays both TCP and UDP through the client's SOCKS5 proxy. Exercises the quinn 0-RTT server config path (max_early_data_size = u32::MAX) and theinto_0rtt()accept path inwind_tuic::quinn::inbound. The quinn backend is the default but had no 0-RTT coverage.quiche backend (extended) —
crates/tuic-tests/tests/quiche_zero_rtt.rs:quiche_zero_rtt_tcp_and_udp_relayso both backends are tested at parity.Helpers —
crates/tuic-tests/src/lib.rs:quinn_server_configandstart_quinn_pair, mirroring the quiche equivalents.quiche_client_config→tuic_client_config(the client is always quinn regardless of the server's backend), now shared by bothstart_quiche_pairandstart_quinn_pair.Why
The default (quinn) backend had no 0-RTT regression coverage, and the quiche 0-RTT test was TCP-only. This fills both gaps with matching TCP+UDP coverage on each backend.
Reviewer notes
tls.alpnstraight through to the QUIC server config, whereas the quiche backend internally forcesh3. So the quinn server helper must setalpn: vec!["h3"]explicitly — otherwise ALPN negotiation fails against the client'sh3and the relay never connects (fails even with 0-RTT off). Noted in a comment on the helper.#[serial]and run in their own binaries becausetuic_client::runinstalls a process-global connection.Test plan
Both pass locally (TCP + UDP). Existing quiche integration test still passes after the helper rename.
🤖 Generated with Claude Code