Skip to content

Fix benchmark_http_client_test.cc and add test cases.#368

Merged
mum4k merged 4 commits intoenvoyproxy:masterfrom
qqustc:fix-bm-client-test
Jun 19, 2020
Merged

Fix benchmark_http_client_test.cc and add test cases.#368
mum4k merged 4 commits intoenvoyproxy:masterfrom
qqustc:fix-bm-client-test

Conversation

@qqustc
Copy link
Copy Markdown
Contributor

@qqustc qqustc commented Jun 17, 2020

Fix benchmark_http_client_test.cc which has a bug in function testBasicFunctionality().

For example, if we have a test fixture with testBasicFunctionality(max_pending=0,connection_limit=15,amount_of_request=10),
then EXPECT_FALSE(client_->tryStartRequest(f)) and
EXPECT_EQ(max_pending == 0 ? 1 : max_pending, inflight_response_count) will fail.

For test fixture with
testBasicFunctionality(max_pending=2,connection_limit=3,amount_of_request=10),
EXPECT_EQ(max_pending == 0 ? 1 : max_pending, inflight_response_count) will fail.

Added 2 test cases to verify the expected behavior fixed by this change.

Tested:
Unit test.

@qqustc qqustc closed this Jun 17, 2020
@qqustc qqustc reopened this Jun 17, 2020
qqustc added 2 commits June 17, 2020 14:40
Fix benchmark_http_client_test.cc which has a bug in function testBasicFunctionality().
Added 2 test cases to verify the expected behavior.

Signed-off-by: qqustc <qqin@google.com>
Signed-off-by: qqustc <qqin@google.com>
@qqustc qqustc marked this pull request as ready for review June 17, 2020 18:42
Signed-off-by: qqustc <qqin@google.com>
@mum4k mum4k requested a review from oschaaf June 19, 2020 00:46
@mum4k mum4k self-assigned this Jun 19, 2020
@mum4k mum4k added waiting-for-review A PR waiting for a review. P2 labels Jun 19, 2020
Copy link
Copy Markdown
Member

@oschaaf oschaaf left a comment

Choose a reason for hiding this comment

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

Nice! LGTM overall, one small request.

};

// Note we we explicitly do not expect encodeData to be called.
EXPECT_CALL(stream_encoder_, encodeData(_, _)).Times(0);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(Optional) now that we actually have an explicit expectation in place instead of an implied one, we could probably do without the comment above this line?

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.

Done.

Thank you Otto for the review.
Verified the change pass all unit tests except termination_predicate_test which is failing at master branch.

bazel test test:all

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great, thank you, this looks good to me. As for the termination_predicate_test failure, could you paste the details here or in a separate issue? Maybe it is flaking (I can't find an occurrence of that, neither on master).

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.

Thanks Otto.
Opened an issue here
#372

@oschaaf oschaaf added waiting-for-changes A PR waiting for comments to be resolved and changes to be applied. and removed waiting-for-review A PR waiting for a review. labels Jun 19, 2020
Signed-off-by: qqustc <qqin@google.com>
@oschaaf oschaaf added waiting-for-review A PR waiting for a review. and removed waiting-for-changes A PR waiting for comments to be resolved and changes to be applied. labels Jun 19, 2020
@mum4k mum4k merged commit 317dba6 into envoyproxy:master Jun 19, 2020
@qqustc qqustc deleted the fix-bm-client-test branch June 19, 2020 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 waiting-for-review A PR waiting for a review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants