Skip to content

HTTP/3: add Http3StreamDataVIOAdaptor unit tests - #13632

Draft
brbzull0 wants to merge 1 commit into
apache:masterfrom
brbzull0:h3-stream-data-vio-adaptor-tests
Draft

HTTP/3: add Http3StreamDataVIOAdaptor unit tests#13632
brbzull0 wants to merge 1 commit into
apache:masterfrom
brbzull0:h3-stream-data-vio-adaptor-tests

Conversation

@brbzull0

@brbzull0 brbzull0 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Http3StreamDataVIOAdaptor has no unit test. Its finalize() drain is
currently exercised only indirectly, through the h3_* autests, which need a
full QUIC stack and so do not run in configurations without a QUIC backend.

This adds a catch2 case, Http3StreamDataVIOAdaptor delivers a multi-frame body intact, which builds an adaptor over a sink VIO, pushes a body across several
DATA frames through handle_frame(), calls finalize(), and asserts the sink
received the whole body -- both sink_reader->read_avail() and
sink_vio.nbytes.

This is test-only. No production behaviour changes.

The drain itself is already correct on master: 3076c17172 (#13213) anchors
_reader in the constructor, before any payload is written, so finalize()
drains the buffer from its head rather than from whatever block is current.

The test is a real regression test for that behaviour, not a tautology. Changing
finalize() to allocate its reader at finalize time instead of using the
anchored _reader reproduces the pre-3076c17172 shape, and the test then
fails on both assertions with 50 == 200 -- only the last block's worth of a
200-byte body reaches the sink.

Note on src/proxy/http3/CMakeLists.txt

This adds two entries to the test_http3 target: the new test file, and
Http3StreamDataVIOAdaptor.cc so the adaptor links.

#13629 adds that same Http3StreamDataVIOAdaptor.cc entry for its own test.
The two changes overlap on that one line, so whichever merges second needs a
one-line conflict resolution. Both are otherwise independent and each builds and
passes on its own against master.

Test

test_http3: 137 assertions in 16 test cases, up from 134 in 15 on master.

Http3StreamDataVIOAdaptor has no unit test, so its finalize() drain is
covered only indirectly through the h3 autests. Add a catch2 case that
pushes a multi-frame body through handle_frame() and asserts finalize()
hands all of it to the sink VIO.
@brbzull0 brbzull0 self-assigned this Sep 3, 2026
@brbzull0 brbzull0 added this to the 11.0.0 milestone Sep 3, 2026
@brbzull0

brbzull0 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

[approve ci autest 0]

@brbzull0

brbzull0 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

[approve ci autest 2]

@brbzull0

brbzull0 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

[approve ci autest 3]

@brbzull0

brbzull0 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

[approve ci freebsd clang-analyzer autest]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant