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

add test case for stream reset during delay injection #354

Merged
merged 2 commits into from
Jan 17, 2017

Conversation

rshriram
Copy link
Member

fixes #342

@rshriram
Copy link
Member Author

@mattklein123 LMK if this covers the test case you talked about.


// Prep up with a 5s delay
EXPECT_CALL(runtime_.snapshot_, featureEnabled("fault.http.delay.fixed_delay_percent", 100))
.Times(1)
Copy link
Member

Choose a reason for hiding this comment

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

nit: Times(1) is implied when you do .WillOnce() or just a plain expect_call, so can typically be removed. There are multiple cases in here where this applies.

EXPECT_CALL(filter_callbacks_, continueDecoding()).Times(0);
EXPECT_EQ(0UL, config_->stats().aborts_injected_.value());

EXPECT_EQ(FilterDataStatus::Continue, filter_->decodeData(data_, true));
Copy link
Member

Choose a reason for hiding this comment

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

Though it works from a "test this thing" perspective, this is not a totally realistic test case. What you are doing here is calling decodeData with end_stream = true. This means that the request is over, as such it's impossible for decodeTrailers() to be called, so I would delete line 453. FYI, it is possible for resetStream callback to get called even when request is complete, since downstream can reset waiting for a response.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good to know. fixed the code and removed the silly .Times(1) from all tests. Thanks for the feedback!

@mattklein123 mattklein123 merged commit e5f1761 into envoyproxy:master Jan 17, 2017
@rshriram rshriram deleted the fault_injection_fix_test branch January 30, 2017 02:39
wolfguoliang pushed a commit to wolfguoliang/envoy that referenced this pull request Jan 23, 2021
…lter.rst (envoyproxy#479)

* envoyproxy#354 translate dynamodb_filter

* envoyproxy#354 zh-translation: docs/root/configuration/http/http_filters/dynamodb_filter.rst, fix

* envoyproxy#354 zh-translation: docs/root/configuration/http/http_filters/dynamodb_filter.rst, fix review comment

Co-authored-by: niushaohan <shaohan.niu@dfgroup.pro>
jpsim pushed a commit that referenced this pull request Nov 28, 2022
Per the discussion [here](envoyproxy/envoy-mobile#312 (comment)), updating the unary and streaming interfaces.

- Moved the non-streaming convenience function into an extension on the protocol type so that it's available to all consumers
- Added a test to validate the default behavior of this extension function
- Added a `CancelableStream` protocol which includes a subset of functionality from the `StreamEmitter`, allowing consumers of the unary function to cancel requests without having the ability to send additional data into the stream

Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit that referenced this pull request Nov 29, 2022
Per the discussion [here](envoyproxy/envoy-mobile#312 (comment)), updating the unary and streaming interfaces.

- Moved the non-streaming convenience function into an extension on the protocol type so that it's available to all consumers
- Added a test to validate the default behavior of this extension function
- Added a `CancelableStream` protocol which includes a subset of functionality from the `StreamEmitter`, allowing consumers of the unary function to cancel requests without having the ability to send additional data into the stream

Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: JP Simard <jp@jpsim.com>
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.

missing coverage in fault filter
2 participants