HTTP/3: add Http3StreamDataVIOAdaptor unit tests - #13632
Draft
brbzull0 wants to merge 1 commit into
Draft
Conversation
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.
Contributor
Author
|
[approve ci autest 0] |
Contributor
Author
|
[approve ci autest 2] |
Contributor
Author
|
[approve ci autest 3] |
Contributor
Author
|
[approve ci freebsd clang-analyzer autest] |
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.
Http3StreamDataVIOAdaptorhas no unit test. Itsfinalize()drain iscurrently exercised only indirectly, through the
h3_*autests, which need afull 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 severalDATA frames through
handle_frame(), callsfinalize(), and asserts the sinkreceived the whole body -- both
sink_reader->read_avail()andsink_vio.nbytes.This is test-only. No production behaviour changes.
The drain itself is already correct on master:
3076c17172(#13213) anchors_readerin the constructor, before any payload is written, sofinalize()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 theanchored
_readerreproduces the pre-3076c17172shape, and the test thenfails on both assertions with
50 == 200-- only the last block's worth of a200-byte body reaches the sink.
Note on
src/proxy/http3/CMakeLists.txtThis adds two entries to the
test_http3target: the new test file, andHttp3StreamDataVIOAdaptor.ccso the adaptor links.#13629 adds that same
Http3StreamDataVIOAdaptor.ccentry 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.