aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/end2end
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2016-07-19 08:36:52 -0700
committerGravatar Mark D. Roth <roth@google.com>2016-07-19 08:36:52 -0700
commitb5f32f0aad59c98e89734f7932fc374cdf475b3a (patch)
tree55c09282079617c8fcb9b32c9f4acd3d7348db92 /test/core/end2end
parent44a2f25667fa902edcfa0e184be9e980ac002664 (diff)
Add test filter right before connected channel filter.
Diffstat (limited to 'test/core/end2end')
-rw-r--r--test/core/end2end/tests/filter_call_init_fails.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/core/end2end/tests/filter_call_init_fails.c b/test/core/end2end/tests/filter_call_init_fails.c
index 78cc56921e..1be6b8bdea 100644
--- a/test/core/end2end/tests/filter_call_init_fails.c
+++ b/test/core/end2end/tests/filter_call_init_fails.c
@@ -239,8 +239,15 @@ static const grpc_channel_filter test_filter = {
static bool maybe_add_filter(grpc_channel_stack_builder *builder, void *arg) {
if (g_enable_filter) {
- return grpc_channel_stack_builder_append_filter(builder, &test_filter,
- NULL, NULL);
+ // Want to add the filter as close to the end as possible, to make
+ // sure that all of the filters work well together. However, we
+ // can't add it at the very end, because the connected channel filter
+ // must be the last one. So we add it right before the last one.
+ grpc_channel_stack_builder_iterator *it =
+ grpc_channel_stack_builder_create_iterator_at_last(builder);
+ GPR_ASSERT(grpc_channel_stack_builder_move_prev(it));
+ return grpc_channel_stack_builder_add_filter_before(it, &test_filter,
+ NULL, NULL);
} else {
return true;
}