Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connect: regression testing bugfix #34112

Merged
merged 4 commits into from
May 16, 2024
Merged

Conversation

alyssawilk
Copy link
Contributor

@alyssawilk alyssawilk commented May 13, 2024

Commit Message: n/a
Additional Description: n/a
Risk Level: n/a (test only)
Testing: yep
tests #34096

Copy link

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #34112 was opened by alyssawilk.

see: more, trace.

@alyssawilk alyssawilk marked this pull request as ready for review May 13, 2024 13:30
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Comment on lines 84 to 85
status_200_ = parser().getStatus() != Http::Http1::ParserStatus::Error &&
parser().statusCode() == Http::Code::OK;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not put this operation into the status200() function rather than precalculating and storing? (If there is a reason, a comment explaining that reason would be good.)

Copy link
Contributor

Choose a reason for hiding this comment

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

(I see the reason in #34096 now, so explanatory comment is the request!)

// Strip the CONNECT upgrade.
std::string prefix_data;
const std::string hostname(default_request_headers_.getHostValue());
ASSERT_TRUE(fake_upstream_connection_->waitForInexactRawData("\r\n\r\n", &prefix_data));
EXPECT_EQ(absl::StrCat("CONNECT ", hostname, ":443 HTTP/1.1\r\n\r\n"), prefix_data);

std::string content_length = include_content_length ? "Content-Length: 0\r\n" : "";
Copy link
Contributor

Choose a reason for hiding this comment

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

Super-nitty since it's just a test, but absl::string_view is good for this.

Comment on lines +455 to +456
// Regression tests https://github.com/envoyproxy/envoy/issues/34096
TEST_P(Http11ConnectHttpIntegrationTest, DfpWithProxyAddressAndContentLength) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the test without content length also still exist?

Copy link
Contributor

Choose a reason for hiding this comment

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

Didn't get a response on this comment. Seems like both paths should be getting tested.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah sorry we do that by default - all th eother tests test this with stripConnectUpgradeAndRespond()

@ravenblackx ravenblackx self-assigned this May 13, 2024
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
ravenblackx
ravenblackx previously approved these changes May 13, 2024
@RenjieTang
Copy link
Contributor

I was thinking maybe the fix should be in Envoy's BalsaParser implementation?

It kinda scares me that after the parser finishes executing an input, the headers_ object is cleared. Maybe the headers should just stay?

@alyssawilk
Copy link
Contributor Author

yeah said on ucn chat, I'm hoping we can land a real fix in google3 ASAP at which point I'll put this on hold, and use it to regression test after import lands.
If we can't get a balsa fix in by wednesday we can patch this workaround in as a temporary thing.

@alyssawilk
Copy link
Contributor Author

/wait on decision making

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@alyssawilk alyssawilk changed the title connect: working around balsa bug connect: regression testing bugfix May 15, 2024
@alyssawilk alyssawilk enabled auto-merge (squash) May 15, 2024 20:46
@alyssawilk
Copy link
Contributor Author

balsa fix landed, so this is now a test-only change

@alyssawilk
Copy link
Contributor Author

/retest

Comment on lines +455 to +456
// Regression tests https://github.com/envoyproxy/envoy/issues/34096
TEST_P(Http11ConnectHttpIntegrationTest, DfpWithProxyAddressAndContentLength) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Didn't get a response on this comment. Seems like both paths should be getting tested.

@alyssawilk alyssawilk merged commit 119fbc3 into envoyproxy:main May 16, 2024
51 checks passed
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.

None yet

3 participants