diff options
author | 2017-12-08 10:19:56 -0800 | |
---|---|---|
committer | 2017-12-08 10:19:56 -0800 | |
commit | ca398ee74a7aed2a45ae58e3c5753c4c99e4d683 (patch) | |
tree | 0e49ba3759a117b66c598158d6ba745178a8ffce /test/core/end2end/tests | |
parent | 54961bb9e16f84d193077277f7d2d8269f57a411 (diff) | |
parent | 94e676e10f8c739289924b8458a246699e3623ce (diff) |
Merge branch 'master' into cv-wait-monotonic
Diffstat (limited to 'test/core/end2end/tests')
-rw-r--r-- | test/core/end2end/tests/cancel_after_accept.cc | 5 | ||||
-rw-r--r-- | test/core/end2end/tests/cancel_after_round_trip.cc | 5 | ||||
-rw-r--r-- | test/core/end2end/tests/compressed_payload.cc | 19 | ||||
-rw-r--r-- | test/core/end2end/tests/connectivity.cc | 3 | ||||
-rw-r--r-- | test/core/end2end/tests/filter_call_init_fails.cc | 19 | ||||
-rw-r--r-- | test/core/end2end/tests/filter_causes_close.cc | 24 | ||||
-rw-r--r-- | test/core/end2end/tests/filter_latency.cc | 18 | ||||
-rw-r--r-- | test/core/end2end/tests/load_reporting_hook.cc | 5 | ||||
-rw-r--r-- | test/core/end2end/tests/max_message_length.cc | 18 | ||||
-rw-r--r-- | test/core/end2end/tests/stream_compression_compressed_payload.cc | 19 | ||||
-rw-r--r-- | test/core/end2end/tests/stream_compression_payload.cc | 7 | ||||
-rw-r--r-- | test/core/end2end/tests/stream_compression_ping_pong_streaming.cc | 7 | ||||
-rw-r--r-- | test/core/end2end/tests/workaround_cronet_compression.cc | 12 |
13 files changed, 63 insertions, 98 deletions
diff --git a/test/core/end2end/tests/cancel_after_accept.cc b/test/core/end2end/tests/cancel_after_accept.cc index 83439d71d2..f59caf7e35 100644 --- a/test/core/end2end/tests/cancel_after_accept.cc +++ b/test/core/end2end/tests/cancel_after_accept.cc @@ -245,9 +245,8 @@ static void test_cancel_after_accept(grpc_end2end_test_config config, grpc_call_unref(s); if (args != nullptr) { - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_channel_args_destroy(&exec_ctx, args); - grpc_exec_ctx_finish(&exec_ctx); + grpc_core::ExecCtx exec_ctx; + grpc_channel_args_destroy(args); } cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/cancel_after_round_trip.cc b/test/core/end2end/tests/cancel_after_round_trip.cc index ddcec67de5..b10b93978d 100644 --- a/test/core/end2end/tests/cancel_after_round_trip.cc +++ b/test/core/end2end/tests/cancel_after_round_trip.cc @@ -278,9 +278,8 @@ static void test_cancel_after_round_trip(grpc_end2end_test_config config, grpc_call_unref(s); if (args != nullptr) { - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_channel_args_destroy(&exec_ctx, args); - grpc_exec_ctx_finish(&exec_ctx); + grpc_core::ExecCtx exec_ctx; + grpc_channel_args_destroy(args); } cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/compressed_payload.cc b/test/core/end2end/tests/compressed_payload.cc index a8ea0ff2e0..944edc7a70 100644 --- a/test/core/end2end/tests/compressed_payload.cc +++ b/test/core/end2end/tests/compressed_payload.cc @@ -129,10 +129,9 @@ static void request_for_disabled_algorithm( server_args = grpc_channel_args_set_compression_algorithm(nullptr, GRPC_COMPRESS_NONE); { - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + grpc_core::ExecCtx exec_ctx; server_args = grpc_channel_args_compression_algorithm_set_state( - &exec_ctx, &server_args, algorithm_to_disable, false); - grpc_exec_ctx_finish(&exec_ctx); + &server_args, algorithm_to_disable, false); } f = begin_test(config, test_name, client_args, server_args); @@ -257,10 +256,9 @@ static void request_for_disabled_algorithm( grpc_byte_buffer_destroy(request_payload_recv); { - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_channel_args_destroy(&exec_ctx, client_args); - grpc_channel_args_destroy(&exec_ctx, server_args); - grpc_exec_ctx_finish(&exec_ctx); + grpc_core::ExecCtx exec_ctx; + grpc_channel_args_destroy(client_args); + grpc_channel_args_destroy(server_args); } end_test(&f); @@ -539,10 +537,9 @@ static void request_with_payload_template( cq_verifier_destroy(cqv); { - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_channel_args_destroy(&exec_ctx, client_args); - grpc_channel_args_destroy(&exec_ctx, server_args); - grpc_exec_ctx_finish(&exec_ctx); + grpc_core::ExecCtx exec_ctx; + grpc_channel_args_destroy(client_args); + grpc_channel_args_destroy(server_args); } end_test(&f); diff --git a/test/core/end2end/tests/connectivity.cc b/test/core/end2end/tests/connectivity.cc index 2ea4ca81f5..da65080bc0 100644 --- a/test/core/end2end/tests/connectivity.cc +++ b/test/core/end2end/tests/connectivity.cc @@ -68,7 +68,8 @@ static void test_connectivity(grpc_end2end_test_config config) { ce.cq = f.cq; gpr_event_init(&ce.started); gpr_thd_options_set_joinable(&thdopt); - GPR_ASSERT(gpr_thd_new(&thdid, child_thread, &ce, &thdopt)); + GPR_ASSERT( + gpr_thd_new(&thdid, "grpc_connectivity", child_thread, &ce, &thdopt)); gpr_event_wait(&ce.started, gpr_inf_future(GPR_CLOCK_MONOTONIC)); diff --git a/test/core/end2end/tests/filter_call_init_fails.cc b/test/core/end2end/tests/filter_call_init_fails.cc index 6eed68a2f9..8f46f0bb91 100644 --- a/test/core/end2end/tests/filter_call_init_fails.cc +++ b/test/core/end2end/tests/filter_call_init_fails.cc @@ -399,26 +399,23 @@ static void test_client_subchannel_filter(grpc_end2end_test_config config) { * Test filter - always fails to initialize a call */ -static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx, - grpc_call_element* elem, +static grpc_error* init_call_elem(grpc_call_element* elem, const grpc_call_element_args* args) { return grpc_error_set_int( GRPC_ERROR_CREATE_FROM_STATIC_STRING("access denied"), GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_PERMISSION_DENIED); } -static void destroy_call_elem(grpc_exec_ctx* exec_ctx, grpc_call_element* elem, +static void destroy_call_elem(grpc_call_element* elem, const grpc_call_final_info* final_info, grpc_closure* ignored) {} -static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx, - grpc_channel_element* elem, +static grpc_error* init_channel_elem(grpc_channel_element* elem, grpc_channel_element_args* args) { return GRPC_ERROR_NONE; } -static void destroy_channel_elem(grpc_exec_ctx* exec_ctx, - grpc_channel_element* elem) {} +static void destroy_channel_elem(grpc_channel_element* elem) {} static const grpc_channel_filter test_filter = { grpc_call_next_op, @@ -437,8 +434,7 @@ static const grpc_channel_filter test_filter = { * Registration */ -static bool maybe_add_server_channel_filter(grpc_exec_ctx* exec_ctx, - grpc_channel_stack_builder* builder, +static bool maybe_add_server_channel_filter(grpc_channel_stack_builder* builder, void* arg) { if (g_enable_server_channel_filter) { // Want to add the filter as close to the end as possible, to make @@ -457,8 +453,7 @@ static bool maybe_add_server_channel_filter(grpc_exec_ctx* exec_ctx, } } -static bool maybe_add_client_channel_filter(grpc_exec_ctx* exec_ctx, - grpc_channel_stack_builder* builder, +static bool maybe_add_client_channel_filter(grpc_channel_stack_builder* builder, void* arg) { if (g_enable_client_channel_filter) { // Want to add the filter as close to the end as possible, to make @@ -478,7 +473,7 @@ static bool maybe_add_client_channel_filter(grpc_exec_ctx* exec_ctx, } static bool maybe_add_client_subchannel_filter( - grpc_exec_ctx* exec_ctx, grpc_channel_stack_builder* builder, void* arg) { + grpc_channel_stack_builder* builder, void* arg) { if (g_enable_client_subchannel_filter) { // 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 diff --git a/test/core/end2end/tests/filter_causes_close.cc b/test/core/end2end/tests/filter_causes_close.cc index 793f590686..ec8f9dbe00 100644 --- a/test/core/end2end/tests/filter_causes_close.cc +++ b/test/core/end2end/tests/filter_causes_close.cc @@ -197,12 +197,11 @@ typedef struct { uint8_t unused; } channel_data; -static void recv_im_ready(grpc_exec_ctx* exec_ctx, void* arg, - grpc_error* error) { +static void recv_im_ready(void* arg, grpc_error* error) { grpc_call_element* elem = (grpc_call_element*)arg; call_data* calld = (call_data*)elem->call_data; GRPC_CLOSURE_RUN( - exec_ctx, calld->recv_im_ready, + calld->recv_im_ready, grpc_error_set_int(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING( "Failure that's not preventable.", &error, 1), GRPC_ERROR_INT_GRPC_STATUS, @@ -210,8 +209,7 @@ static void recv_im_ready(grpc_exec_ctx* exec_ctx, void* arg, } static void start_transport_stream_op_batch( - grpc_exec_ctx* exec_ctx, grpc_call_element* elem, - grpc_transport_stream_op_batch* op) { + grpc_call_element* elem, grpc_transport_stream_op_batch* op) { call_data* calld = (call_data*)elem->call_data; if (op->recv_initial_metadata) { calld->recv_im_ready = @@ -219,27 +217,24 @@ static void start_transport_stream_op_batch( op->payload->recv_initial_metadata.recv_initial_metadata_ready = GRPC_CLOSURE_CREATE(recv_im_ready, elem, grpc_schedule_on_exec_ctx); } - grpc_call_next_op(exec_ctx, elem, op); + grpc_call_next_op(elem, op); } -static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx, - grpc_call_element* elem, +static grpc_error* init_call_elem(grpc_call_element* elem, const grpc_call_element_args* args) { return GRPC_ERROR_NONE; } -static void destroy_call_elem(grpc_exec_ctx* exec_ctx, grpc_call_element* elem, +static void destroy_call_elem(grpc_call_element* elem, const grpc_call_final_info* final_info, grpc_closure* ignored) {} -static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx, - grpc_channel_element* elem, +static grpc_error* init_channel_elem(grpc_channel_element* elem, grpc_channel_element_args* args) { return GRPC_ERROR_NONE; } -static void destroy_channel_elem(grpc_exec_ctx* exec_ctx, - grpc_channel_element* elem) {} +static void destroy_channel_elem(grpc_channel_element* elem) {} static const grpc_channel_filter test_filter = { start_transport_stream_op_batch, @@ -258,8 +253,7 @@ static const grpc_channel_filter test_filter = { * Registration */ -static bool maybe_add_filter(grpc_exec_ctx* exec_ctx, - grpc_channel_stack_builder* builder, void* arg) { +static bool maybe_add_filter(grpc_channel_stack_builder* builder, void* arg) { if (g_enable_filter) { return grpc_channel_stack_builder_prepend_filter(builder, &test_filter, nullptr, nullptr); diff --git a/test/core/end2end/tests/filter_latency.cc b/test/core/end2end/tests/filter_latency.cc index c4d96ebfe2..845cbc01cf 100644 --- a/test/core/end2end/tests/filter_latency.cc +++ b/test/core/end2end/tests/filter_latency.cc @@ -247,14 +247,12 @@ static void test_request(grpc_end2end_test_config config) { * Test latency filter */ -static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx, - grpc_call_element* elem, +static grpc_error* init_call_elem(grpc_call_element* elem, const grpc_call_element_args* args) { return GRPC_ERROR_NONE; } -static void client_destroy_call_elem(grpc_exec_ctx* exec_ctx, - grpc_call_element* elem, +static void client_destroy_call_elem(grpc_call_element* elem, const grpc_call_final_info* final_info, grpc_closure* ignored) { gpr_mu_lock(&g_mu); @@ -262,8 +260,7 @@ static void client_destroy_call_elem(grpc_exec_ctx* exec_ctx, gpr_mu_unlock(&g_mu); } -static void server_destroy_call_elem(grpc_exec_ctx* exec_ctx, - grpc_call_element* elem, +static void server_destroy_call_elem(grpc_call_element* elem, const grpc_call_final_info* final_info, grpc_closure* ignored) { gpr_mu_lock(&g_mu); @@ -271,14 +268,12 @@ static void server_destroy_call_elem(grpc_exec_ctx* exec_ctx, gpr_mu_unlock(&g_mu); } -static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx, - grpc_channel_element* elem, +static grpc_error* init_channel_elem(grpc_channel_element* elem, grpc_channel_element_args* args) { return GRPC_ERROR_NONE; } -static void destroy_channel_elem(grpc_exec_ctx* exec_ctx, - grpc_channel_element* elem) {} +static void destroy_channel_elem(grpc_channel_element* elem) {} static const grpc_channel_filter test_client_filter = { grpc_call_next_op, @@ -310,8 +305,7 @@ static const grpc_channel_filter test_server_filter = { * Registration */ -static bool maybe_add_filter(grpc_exec_ctx* exec_ctx, - grpc_channel_stack_builder* builder, void* arg) { +static bool maybe_add_filter(grpc_channel_stack_builder* builder, void* arg) { grpc_channel_filter* filter = (grpc_channel_filter*)arg; if (g_enable_filter) { // Want to add the filter as close to the end as possible, to make diff --git a/test/core/end2end/tests/load_reporting_hook.cc b/test/core/end2end/tests/load_reporting_hook.cc index faabec34cb..e056bd547b 100644 --- a/test/core/end2end/tests/load_reporting_hook.cc +++ b/test/core/end2end/tests/load_reporting_hook.cc @@ -300,9 +300,8 @@ static void test_load_reporting_hook(grpc_end2end_test_config config) { &trailing_lr_metadata); end_test(&f); { - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_channel_args_destroy(&exec_ctx, lr_server_args); - grpc_exec_ctx_finish(&exec_ctx); + grpc_core::ExecCtx exec_ctx; + grpc_channel_args_destroy(lr_server_args); } config.tear_down_data(&f); } diff --git a/test/core/end2end/tests/max_message_length.cc b/test/core/end2end/tests/max_message_length.cc index f1ac27fa7c..e581f1fc20 100644 --- a/test/core/end2end/tests/max_message_length.cc +++ b/test/core/end2end/tests/max_message_length.cc @@ -173,12 +173,9 @@ static void test_max_message_length_on_request(grpc_end2end_test_config config, f = begin_test(config, "test_max_request_message_length", client_args, server_args); { - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - if (client_args != nullptr) - grpc_channel_args_destroy(&exec_ctx, client_args); - if (server_args != nullptr) - grpc_channel_args_destroy(&exec_ctx, server_args); - grpc_exec_ctx_finish(&exec_ctx); + grpc_core::ExecCtx exec_ctx; + if (client_args != nullptr) grpc_channel_args_destroy(client_args); + if (server_args != nullptr) grpc_channel_args_destroy(server_args); } cqv = cq_verifier_create(f.cq); @@ -366,12 +363,9 @@ static void test_max_message_length_on_response(grpc_end2end_test_config config, f = begin_test(config, "test_max_response_message_length", client_args, server_args); { - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - if (client_args != nullptr) - grpc_channel_args_destroy(&exec_ctx, client_args); - if (server_args != nullptr) - grpc_channel_args_destroy(&exec_ctx, server_args); - grpc_exec_ctx_finish(&exec_ctx); + grpc_core::ExecCtx exec_ctx; + if (client_args != nullptr) grpc_channel_args_destroy(client_args); + if (server_args != nullptr) grpc_channel_args_destroy(server_args); } cqv = cq_verifier_create(f.cq); diff --git a/test/core/end2end/tests/stream_compression_compressed_payload.cc b/test/core/end2end/tests/stream_compression_compressed_payload.cc index d73346468a..ec3050ad45 100644 --- a/test/core/end2end/tests/stream_compression_compressed_payload.cc +++ b/test/core/end2end/tests/stream_compression_compressed_payload.cc @@ -129,10 +129,9 @@ static void request_for_disabled_algorithm( server_args = grpc_channel_args_set_stream_compression_algorithm( nullptr, GRPC_STREAM_COMPRESS_NONE); { - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + grpc_core::ExecCtx exec_ctx; server_args = grpc_channel_args_stream_compression_algorithm_set_state( - &exec_ctx, &server_args, algorithm_to_disable, false); - grpc_exec_ctx_finish(&exec_ctx); + &server_args, algorithm_to_disable, false); } f = begin_test(config, test_name, client_args, server_args); @@ -258,10 +257,9 @@ static void request_for_disabled_algorithm( grpc_byte_buffer_destroy(request_payload_recv); { - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_channel_args_destroy(&exec_ctx, client_args); - grpc_channel_args_destroy(&exec_ctx, server_args); - grpc_exec_ctx_finish(&exec_ctx); + grpc_core::ExecCtx exec_ctx; + grpc_channel_args_destroy(client_args); + grpc_channel_args_destroy(server_args); } end_test(&f); @@ -547,10 +545,9 @@ static void request_with_payload_template( cq_verifier_destroy(cqv); { - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_channel_args_destroy(&exec_ctx, client_args); - grpc_channel_args_destroy(&exec_ctx, server_args); - grpc_exec_ctx_finish(&exec_ctx); + grpc_core::ExecCtx exec_ctx; + grpc_channel_args_destroy(client_args); + grpc_channel_args_destroy(server_args); } end_test(&f); diff --git a/test/core/end2end/tests/stream_compression_payload.cc b/test/core/end2end/tests/stream_compression_payload.cc index 924961ea55..b95e6528cd 100644 --- a/test/core/end2end/tests/stream_compression_payload.cc +++ b/test/core/end2end/tests/stream_compression_payload.cc @@ -277,10 +277,9 @@ static void test_invoke_request_response_with_payload( end_test(&f); config.tear_down_data(&f); { - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_channel_args_destroy(&exec_ctx, client_args); - grpc_channel_args_destroy(&exec_ctx, server_args); - grpc_exec_ctx_finish(&exec_ctx); + grpc_core::ExecCtx exec_ctx; + grpc_channel_args_destroy(client_args); + grpc_channel_args_destroy(server_args); } } diff --git a/test/core/end2end/tests/stream_compression_ping_pong_streaming.cc b/test/core/end2end/tests/stream_compression_ping_pong_streaming.cc index d3b526f04e..2a8799ee67 100644 --- a/test/core/end2end/tests/stream_compression_ping_pong_streaming.cc +++ b/test/core/end2end/tests/stream_compression_ping_pong_streaming.cc @@ -275,10 +275,9 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, end_test(&f); config.tear_down_data(&f); { - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_channel_args_destroy(&exec_ctx, client_args); - grpc_channel_args_destroy(&exec_ctx, server_args); - grpc_exec_ctx_finish(&exec_ctx); + grpc_core::ExecCtx exec_ctx; + grpc_channel_args_destroy(client_args); + grpc_channel_args_destroy(server_args); } } diff --git a/test/core/end2end/tests/workaround_cronet_compression.cc b/test/core/end2end/tests/workaround_cronet_compression.cc index bc4d5079d8..d4decce0aa 100644 --- a/test/core/end2end/tests/workaround_cronet_compression.cc +++ b/test/core/end2end/tests/workaround_cronet_compression.cc @@ -142,15 +142,14 @@ static void request_with_payload_template( nullptr, default_server_channel_compression_algorithm); if (user_agent_override) { - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + grpc_core::ExecCtx exec_ctx; grpc_channel_args* client_args_old = client_args; grpc_arg arg; arg.key = const_cast<char*>(GRPC_ARG_PRIMARY_USER_AGENT_STRING); arg.type = GRPC_ARG_STRING; arg.value.string = user_agent_override; client_args = grpc_channel_args_copy_and_add(client_args_old, &arg, 1); - grpc_channel_args_destroy(&exec_ctx, client_args_old); - grpc_exec_ctx_finish(&exec_ctx); + grpc_channel_args_destroy(client_args_old); } f = begin_test(config, test_name, client_args, server_args); @@ -351,10 +350,9 @@ static void request_with_payload_template( cq_verifier_destroy(cqv); { - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_channel_args_destroy(&exec_ctx, client_args); - grpc_channel_args_destroy(&exec_ctx, server_args); - grpc_exec_ctx_finish(&exec_ctx); + grpc_core::ExecCtx exec_ctx; + grpc_channel_args_destroy(client_args); + grpc_channel_args_destroy(server_args); } end_test(&f); |