Skip to content

dfp: adding queueing test#18748

Merged
alyssawilk merged 2 commits intoenvoyproxy:mainfrom
alyssawilk:queue
Oct 25, 2021
Merged

dfp: adding queueing test#18748
alyssawilk merged 2 commits intoenvoyproxy:mainfrom
alyssawilk:queue

Conversation

@alyssawilk
Copy link
Contributor

Risk Level: n/a
Testing: new integration test
Docs Changes: n/a
Release Notes: n/a
Fixes #17611

Signed-off-by: Alyssa Wilk <[email protected]>
Copy link
Contributor

@RyanTheOptimist RyanTheOptimist left a comment

Choose a reason for hiding this comment

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

Looks great! Are there any stats that we might want to also consider checking for this case? (Or maybe some stats we should add?)

setDownstreamProtocol(Http::CodecType::HTTP2);
setUpstreamProtocol(Http::CodecType::HTTP2);

// Ensure we only have one connection upstream, one request active at a time.
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for this comment. There is so much boilerplate required to get this config working that I would probably not have figured out the intent.

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 a lot of Envoy tests are hard to read especially with heavy mock use so I encourage overcommenting rather than under :-P

request_encoder_ = &encoder_decoder.first;
auto response = std::move(encoder_decoder.second);

// make sure the headers are received.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: make => Make

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

config_helper_.addConfigModifier([](envoy::config::bootstrap::v3::Bootstrap& bootstrap) {
auto* static_resources = bootstrap.mutable_static_resources();
auto* cluster = static_resources->mutable_clusters(0);
auto* circuit_breakers = cluster->mutable_circuit_breakers();
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: there are quite a few uses of auto here where the type is not really obvious to me. I think the style guide recommends against auto in cases like this. (Down on line 475, too)

https://google.github.io/styleguide/cppguide.html#Type_deduction

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 I think envoy-internal style is to use auto pretty heavily especially for protos where the types are painfully long. I'm up for giving it a shot as beyond it being the style guide, I agree it can be confusing especially to newcomers

I've simply gotten in the habit of "grep for who has implements this function" =P

test_server_->waitForCounterEq("http.config_test.downstream_rq_total", 2);
// Make sure the stream is not received.
ASSERT_FALSE(fake_upstream_connection_->waitForNewStream(*dispatcher_, upstream_request_,
std::chrono::milliseconds(100)));
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems totally reasonable for an integration test, but it's mildly annoying that there is now way to "ensure something will never happen in the future". But I guess that's just not how the world works :)

Signed-off-by: Alyssa Wilk <[email protected]>
Copy link
Contributor

@RyanTheOptimist RyanTheOptimist left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

test queuing requests in DFP when stream limit is maxed out

2 participants