Skip to content

http3: turning up more tests#15853

Merged
alyssawilk merged 11 commits intoenvoyproxy:mainfrom
alyssawilk:mux2
Apr 13, 2021
Merged

http3: turning up more tests#15853
alyssawilk merged 11 commits intoenvoyproxy:mainfrom
alyssawilk:mux2

Conversation

@alyssawilk
Copy link
Copy Markdown
Contributor

@alyssawilk alyssawilk commented Apr 6, 2021

Risk Level: n/a
Testing: yes
Docs Changes: no
Release Notes: no

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@alyssawilk alyssawilk marked this pull request as ready for review April 6, 2021 17:42
Copy link
Copy Markdown
Contributor

@danzh2010 danzh2010 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks a lot for enabling H3 in this test!


void EnvoyQuicServerStream::maybeDecodeTrailers() {
if (sequencer()->IsClosed() && !FinishedReadingTrailers()) {
ASSERT(!received_trailers().empty());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some h2 protocol test sends empty trailer?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, the autonomous upstream sends empty trailers for H2/H3 by default


initialize();
std::string response;
auto connection = createConnectionDriver(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RawConnectionDriver doesn't create a QUIC "connection".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, but I think we need a similar facility to send invalid packets for a quic connection to make sure it's handled gracefully.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

// Send client headers, a GoAway and then a body and ensure the full request and
// response are received.
TEST_P(Http2IntegrationTest, GoAway) {
EXCLUDE_DOWNSTREAM_HTTP3; // QuicHttpClientConnectionImpl::goAway NOT_REACHED_GCOVR_EXCL_LINE
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QUICHE doesn't support client sending GOAWAY as there is no need. AFAIK Envoy doesn't support server push either, why Envoy needs this feature?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine. I think we should test that if the API is called we don't do anything harmful (it should be a no-op like it is for HTTP/1.1, rather than crashing) and we should also test to make sure if a client sends a goaway it is a no-op or treated as a protocol error and again doesn't crash.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also tests that GOAWAY does not cause existing streams to terminate.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For HTTP/2. For HTTP/3 given it's a protocol error to send goaway client -> server, I think it probably would cause connection termination.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a protocol error, but QUICHE client doesn't support it because QUICHE doesn't do server push. I can change NOT_REACHED_GCOVR_EXCL_LINE to log error and return. It won't affect out-going request.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it a protocol error if an H3 server gets a goaway? cc @DavidSchinazi so I don't make things up =P

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alyssawilk that's no longer true in IETF QUIC. Client-to-server GOAWAY tells the server to stop using server push. https://quicwg.org/base-drafts/draft-ietf-quic-http.html#name-goaway

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, thanks, I was looking at the wrong version of the spec, and Dan is of course just more up to date than me :-P

danzh2010
danzh2010 previously approved these changes Apr 7, 2021
Copy link
Copy Markdown
Contributor

@danzh2010 danzh2010 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

// Send client headers, a GoAway and then a body and ensure the full request and
// response are received.
TEST_P(Http2IntegrationTest, GoAway) {
EXCLUDE_DOWNSTREAM_HTTP3; // QuicHttpClientConnectionImpl::goAway NOT_REACHED_GCOVR_EXCL_LINE
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK


initialize();
std::string response;
auto connection = createConnectionDriver(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

TEST_P(Http2IntegrationTest, BadMagic) {
if (downstreamProtocol() == Http::CodecClient::Type::HTTP3) {
return; // protocol-specific framing.
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EXCLUDE_DOWNSTREAM_HTTP3 means need to fix. This one doesn't?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct. I don't think H3 has the equivalent of the initial H2 magic, so we don't have to replicate this test for H3.
I'll add a better comment next I'm in that file.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or just rename the test BadHttp2Magic

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
TEST_P(Http2IntegrationTest, BadMagic) {
if (downstreamProtocol() == Http::CodecClient::Type::HTTP3) {
return; // protocol-specific framing.
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or just rename the test BadHttp2Magic

// Send client headers, a GoAway and then a body and ensure the full request and
// response are received.
TEST_P(Http2IntegrationTest, GoAway) {
EXCLUDE_DOWNSTREAM_HTTP3; // QuicHttpClientConnectionImpl::goAway NOT_REACHED_GCOVR_EXCL_LINE
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also tests that GOAWAY does not cause existing streams to terminate.

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@alyssawilk
Copy link
Copy Markdown
Contributor Author

ok, re-excluded the tests which were failing TSAN. @yanavlasov PTAL?

EXCLUDE_DOWNSTREAM_HTTP3; // sort out timeouts
testRouterRequestAndResponseWithBody(10 * 1024 * 1024, 10 * 1024 * 1024, false, false, nullptr,
10 * TSAN_TIMEOUT_FACTOR * TestUtility::DefaultTimeout);
TSAN_TIMEOUT_FACTOR * TestUtility::DefaultTimeout);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do they simply timed out?
Mind adding TODO for me to re-enable it after #15865?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure. There's already a TODO to look into the excludes so I'd prefer to not do another push-and-ci cycle to update TODO if that's Ok?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. I'll keep in mind of these tests.

@alyssawilk alyssawilk merged commit a527216 into envoyproxy:main Apr 13, 2021
Monkeyanator pushed a commit to Monkeyanator/envoy that referenced this pull request Apr 20, 2021
Risk Level: n/a
Testing: yes
Docs Changes: no
Release Notes: no

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@alyssawilk alyssawilk deleted the mux2 branch February 28, 2022 21:25
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.

4 participants