aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/end2end
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-09-18 09:25:42 -0700
committerGravatar Craig Tiller <ctiller@google.com>2017-09-18 09:25:42 -0700
commit468d1e5b56a72f45ac7efe8f8ca6bca435fd1c39 (patch)
tree4b624fe0b39dd1458fb7fea9043f71425ece2f08 /test/core/end2end
parent4c6f958a25d3fbe562700b46a75c400d9efd8908 (diff)
Fix keepalive test
Diffstat (limited to 'test/core/end2end')
-rw-r--r--test/core/end2end/tests/keepalive_timeout.c32
1 files changed, 13 insertions, 19 deletions
diff --git a/test/core/end2end/tests/keepalive_timeout.c b/test/core/end2end/tests/keepalive_timeout.c
index e0ead4ab62..c4280149c7 100644
--- a/test/core/end2end/tests/keepalive_timeout.c
+++ b/test/core/end2end/tests/keepalive_timeout.c
@@ -98,21 +98,21 @@ static void test_keepalive_timeout(grpc_end2end_test_config config) {
grpc_byte_buffer *response_payload =
grpc_raw_byte_buffer_create(&response_payload_slice, 1);
- grpc_arg keepalive_args[] = {{.type = GRPC_ARG_INTEGER,
- .key = GRPC_ARG_KEEPALIVE_TIME_MS,
- .value.integer = 1500},
- {.type = GRPC_ARG_INTEGER,
- .key = GRPC_ARG_KEEPALIVE_TIMEOUT_MS,
- .value.integer = 0},
- {.type = GRPC_ARG_INTEGER,
- .key = GRPC_ARG_HTTP2_BDP_PROBE,
- .value.integer = 1}};
-
- grpc_channel_args *client_args = NULL;
- client_args = grpc_channel_args_copy_and_add(client_args, keepalive_args, 2);
+ grpc_arg keepalive_arg_elems[] = {{.type = GRPC_ARG_INTEGER,
+ .key = GRPC_ARG_KEEPALIVE_TIME_MS,
+ .value.integer = 1500},
+ {.type = GRPC_ARG_INTEGER,
+ .key = GRPC_ARG_KEEPALIVE_TIMEOUT_MS,
+ .value.integer = 0},
+ {.type = GRPC_ARG_INTEGER,
+ .key = GRPC_ARG_HTTP2_BDP_PROBE,
+ .value.integer = 0}};
+ grpc_channel_args keepalive_args = {
+ .num_args = GPR_ARRAY_SIZE(keepalive_arg_elems),
+ .args = keepalive_arg_elems};
grpc_end2end_test_fixture f =
- begin_test(config, "keepalive_timeout", client_args, NULL);
+ begin_test(config, "keepalive_timeout", &keepalive_args, NULL);
cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_op ops[6];
grpc_op *op;
@@ -216,12 +216,6 @@ static void test_keepalive_timeout(grpc_end2end_test_config config) {
grpc_byte_buffer_destroy(response_payload);
grpc_byte_buffer_destroy(response_payload_recv);
- if (client_args != NULL) {
- grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
- grpc_channel_args_destroy(&exec_ctx, client_args);
- grpc_exec_ctx_finish(&exec_ctx);
- }
-
end_test(&f);
config.tear_down_data(&f);
}