Skip to content

test(tuic): add 0-RTT integration tests for quinn and quiche backends#26

Merged
Itsusinn merged 3 commits into
mainfrom
test/quinn-zero-rtt
Jun 15, 2026
Merged

test(tuic): add 0-RTT integration tests for quinn and quiche backends#26
Itsusinn merged 3 commits into
mainfrom
test/quinn-zero-rtt

Conversation

@Itsusinn

@Itsusinn Itsusinn commented Jun 14, 2026

Copy link
Copy Markdown
Member

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_relay starts a quinn-backed server + client with zero_rtt_handshake = true and 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 the into_0rtt() accept path in wind_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:

  • The existing quiche 0-RTT test only covered TCP. Added UDP (native datagram mode) relay and renamed it to quiche_zero_rtt_tcp_and_udp_relay so both backends are tested at parity.

Helperscrates/tuic-tests/src/lib.rs:

  • quinn_server_config and start_quinn_pair, mirroring the quiche equivalents.
  • Renamed quiche_client_configtuic_client_config (the client is always quinn regardless of the server's backend), now shared by both start_quiche_pair and start_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

  • ALPN gotcha: the quinn backend passes tls.alpn straight through to the QUIC server config, whereas the quiche backend internally forces h3. So the quinn server helper must set alpn: vec!["h3"] explicitly — otherwise ALPN negotiation fails against the client's h3 and the relay never connects (fails even with 0-RTT off). Noted in a comment on the helper.
  • Scope: both tests verify the 0-RTT-enabled config path handshakes and relays correctly. They do not assert early data was replayed on a resumed handshake — the first connection is always 1-RTT, and proving actual replay would need a custom resumption client.
  • Tests are #[serial] and run in their own binaries because tuic_client::run installs a process-global connection.

Test plan

cargo test -p tuic-tests --test quinn_zero_rtt
cargo test -p tuic-tests --test quiche_zero_rtt

Both pass locally (TCP + UDP). Existing quiche integration test still passes after the helper rename.

🤖 Generated with Claude Code

Itsusinn and others added 2 commits June 14, 2026 20:20
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>
@Itsusinn Itsusinn changed the title test(tuic): add quinn-backend 0-RTT integration test test(tuic): add 0-RTT integration tests for quinn and quiche backends Jun 14, 2026
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>
@Itsusinn Itsusinn merged commit 9c56145 into main Jun 15, 2026
17 checks passed
@Itsusinn Itsusinn deleted the test/quinn-zero-rtt branch June 15, 2026 02:06
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.

1 participant