diff options
Diffstat (limited to 'test/core/surface')
-rw-r--r-- | test/core/surface/byte_buffer_reader_test.cc | 8 | ||||
-rw-r--r-- | test/core/surface/channel_create_test.cc | 3 | ||||
-rw-r--r-- | test/core/surface/completion_queue_test.cc | 39 | ||||
-rw-r--r-- | test/core/surface/completion_queue_threading_test.cc | 23 | ||||
-rw-r--r-- | test/core/surface/concurrent_connectivity_test.cc | 58 | ||||
-rw-r--r-- | test/core/surface/lame_client_test.cc | 13 | ||||
-rw-r--r-- | test/core/surface/num_external_connectivity_watchers_test.cc | 5 | ||||
-rw-r--r-- | test/core/surface/secure_channel_create_test.cc | 17 | ||||
-rw-r--r-- | test/core/surface/sequential_connectivity_test.cc | 7 |
9 files changed, 75 insertions, 98 deletions
diff --git a/test/core/surface/byte_buffer_reader_test.cc b/test/core/surface/byte_buffer_reader_test.cc index e5d2d7c78d..94a8615b3c 100644 --- a/test/core/surface/byte_buffer_reader_test.cc +++ b/test/core/surface/byte_buffer_reader_test.cc @@ -132,10 +132,8 @@ static void read_compressed_slice(grpc_compression_algorithm algorithm, memset(GRPC_SLICE_START_PTR(input_slice), 'a', input_size); grpc_slice_buffer_add(&sliceb_in, input_slice); /* takes ownership */ { - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - GPR_ASSERT( - grpc_msg_compress(&exec_ctx, algorithm, &sliceb_in, &sliceb_out)); - grpc_exec_ctx_finish(&exec_ctx); + grpc_core::ExecCtx exec_ctx; + GPR_ASSERT(grpc_msg_compress(algorithm, &sliceb_in, &sliceb_out)); } buffer = grpc_raw_compressed_byte_buffer_create(sliceb_out.slices, @@ -267,6 +265,7 @@ static void test_byte_buffer_copy(void) { int main(int argc, char** argv) { grpc_test_init(argc, argv); + grpc_init(); test_read_one_slice(); test_read_one_slice_malloc(); test_read_none_compressed_slice(); @@ -276,5 +275,6 @@ int main(int argc, char** argv) { test_byte_buffer_from_reader(); test_byte_buffer_copy(); test_readall(); + grpc_shutdown(); return 0; } diff --git a/test/core/surface/channel_create_test.cc b/test/core/surface/channel_create_test.cc index f358b0fc8d..37247f89d0 100644 --- a/test/core/surface/channel_create_test.cc +++ b/test/core/surface/channel_create_test.cc @@ -35,11 +35,10 @@ void test_unknown_scheme_target(void) { chan = grpc_insecure_channel_create("blah://blah", nullptr, nullptr); GPR_ASSERT(chan != nullptr); - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + grpc_core::ExecCtx exec_ctx; grpc_channel_element* elem = grpc_channel_stack_element(grpc_channel_get_channel_stack(chan), 0); GPR_ASSERT(0 == strcmp(elem->filter->name, "lame-client")); - grpc_exec_ctx_finish(&exec_ctx); grpc_channel_destroy(chan); } diff --git a/test/core/surface/completion_queue_test.cc b/test/core/surface/completion_queue_test.cc index c6e13d2386..fefbb3c185 100644 --- a/test/core/surface/completion_queue_test.cc +++ b/test/core/surface/completion_queue_test.cc @@ -121,8 +121,7 @@ static void test_wait_empty(void) { } } -static void do_nothing_end_completion(grpc_exec_ctx* exec_ctx, void* arg, - grpc_cq_completion* c) {} +static void do_nothing_end_completion(void* arg, grpc_cq_completion* c) {} static void test_cq_end_op(void) { grpc_event ev; @@ -131,8 +130,6 @@ static void test_cq_end_op(void) { grpc_cq_polling_type polling_types[] = { GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING}; grpc_completion_queue_attributes attr; - grpc_exec_ctx init_exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_exec_ctx exec_ctx; void* tag = create_test_tag(); LOG_TEST("test_cq_end_op"); @@ -140,14 +137,14 @@ static void test_cq_end_op(void) { attr.version = 1; attr.cq_completion_type = GRPC_CQ_NEXT; for (size_t i = 0; i < GPR_ARRAY_SIZE(polling_types); i++) { - exec_ctx = init_exec_ctx; // Reset exec_ctx + grpc_core::ExecCtx exec_ctx; attr.cq_polling_type = polling_types[i]; cc = grpc_completion_queue_create( grpc_completion_queue_factory_lookup(&attr), &attr, nullptr); GPR_ASSERT(grpc_cq_begin_op(cc, tag)); - grpc_cq_end_op(&exec_ctx, cc, tag, GRPC_ERROR_NONE, - do_nothing_end_completion, nullptr, &completion); + grpc_cq_end_op(cc, tag, GRPC_ERROR_NONE, do_nothing_end_completion, nullptr, + &completion); ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); @@ -156,7 +153,6 @@ static void test_cq_end_op(void) { GPR_ASSERT(ev.success); shutdown_and_destroy(cc); - grpc_exec_ctx_finish(&exec_ctx); } } @@ -167,8 +163,6 @@ static void test_cq_tls_cache_full(void) { grpc_cq_polling_type polling_types[] = { GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING}; grpc_completion_queue_attributes attr; - grpc_exec_ctx init_exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_exec_ctx exec_ctx; void* tag = create_test_tag(); void* res_tag; int ok; @@ -178,15 +172,15 @@ static void test_cq_tls_cache_full(void) { attr.version = 1; attr.cq_completion_type = GRPC_CQ_NEXT; for (size_t i = 0; i < GPR_ARRAY_SIZE(polling_types); i++) { - exec_ctx = init_exec_ctx; // Reset exec_ctx + grpc_core::ExecCtx exec_ctx; // Reset exec_ctx attr.cq_polling_type = polling_types[i]; cc = grpc_completion_queue_create( grpc_completion_queue_factory_lookup(&attr), &attr, nullptr); grpc_completion_queue_thread_local_cache_init(cc); GPR_ASSERT(grpc_cq_begin_op(cc, tag)); - grpc_cq_end_op(&exec_ctx, cc, tag, GRPC_ERROR_NONE, - do_nothing_end_completion, nullptr, &completion); + grpc_cq_end_op(cc, tag, GRPC_ERROR_NONE, do_nothing_end_completion, nullptr, + &completion); ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); @@ -202,7 +196,6 @@ static void test_cq_tls_cache_full(void) { GPR_ASSERT(ev.type == GRPC_QUEUE_TIMEOUT); shutdown_and_destroy(cc); - grpc_exec_ctx_finish(&exec_ctx); } } @@ -211,8 +204,6 @@ static void test_cq_tls_cache_empty(void) { grpc_cq_polling_type polling_types[] = { GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING}; grpc_completion_queue_attributes attr; - grpc_exec_ctx init_exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_exec_ctx exec_ctx; void* res_tag; int ok; @@ -221,7 +212,7 @@ static void test_cq_tls_cache_empty(void) { attr.version = 1; attr.cq_completion_type = GRPC_CQ_NEXT; for (size_t i = 0; i < GPR_ARRAY_SIZE(polling_types); i++) { - exec_ctx = init_exec_ctx; // Reset exec_ctx + grpc_core::ExecCtx exec_ctx; // Reset exec_ctx attr.cq_polling_type = polling_types[i]; cc = grpc_completion_queue_create( grpc_completion_queue_factory_lookup(&attr), &attr, nullptr); @@ -232,7 +223,6 @@ static void test_cq_tls_cache_empty(void) { GPR_ASSERT( grpc_completion_queue_thread_local_cache_flush(cc, &res_tag, &ok) == 0); shutdown_and_destroy(cc); - grpc_exec_ctx_finish(&exec_ctx); } } @@ -289,8 +279,6 @@ static void test_pluck(void) { grpc_cq_polling_type polling_types[] = { GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING}; grpc_completion_queue_attributes attr; - grpc_exec_ctx init_exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_exec_ctx exec_ctx; unsigned i, j; LOG_TEST("test_pluck"); @@ -305,15 +293,15 @@ static void test_pluck(void) { attr.version = 1; attr.cq_completion_type = GRPC_CQ_PLUCK; for (size_t pidx = 0; pidx < GPR_ARRAY_SIZE(polling_types); pidx++) { - exec_ctx = init_exec_ctx; // reset exec_ctx + grpc_core::ExecCtx exec_ctx; // reset exec_ctx attr.cq_polling_type = polling_types[pidx]; cc = grpc_completion_queue_create( grpc_completion_queue_factory_lookup(&attr), &attr, nullptr); for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { GPR_ASSERT(grpc_cq_begin_op(cc, tags[i])); - grpc_cq_end_op(&exec_ctx, cc, tags[i], GRPC_ERROR_NONE, - do_nothing_end_completion, nullptr, &completions[i]); + grpc_cq_end_op(cc, tags[i], GRPC_ERROR_NONE, do_nothing_end_completion, + nullptr, &completions[i]); } for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { @@ -324,8 +312,8 @@ static void test_pluck(void) { for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { GPR_ASSERT(grpc_cq_begin_op(cc, tags[i])); - grpc_cq_end_op(&exec_ctx, cc, tags[i], GRPC_ERROR_NONE, - do_nothing_end_completion, nullptr, &completions[i]); + grpc_cq_end_op(cc, tags[i], GRPC_ERROR_NONE, do_nothing_end_completion, + nullptr, &completions[i]); } for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { @@ -336,7 +324,6 @@ static void test_pluck(void) { } shutdown_and_destroy(cc); - grpc_exec_ctx_finish(&exec_ctx); } } diff --git a/test/core/surface/completion_queue_threading_test.cc b/test/core/surface/completion_queue_threading_test.cc index af54e00c4a..4a9e818b45 100644 --- a/test/core/surface/completion_queue_threading_test.cc +++ b/test/core/surface/completion_queue_threading_test.cc @@ -59,8 +59,7 @@ static void shutdown_and_destroy(grpc_completion_queue* cc) { grpc_completion_queue_destroy(cc); } -static void do_nothing_end_completion(grpc_exec_ctx* exec_ctx, void* arg, - grpc_cq_completion* c) {} +static void do_nothing_end_completion(void* arg, grpc_cq_completion* c) {} struct thread_state { grpc_completion_queue* cc; @@ -81,7 +80,7 @@ static void test_too_many_plucks(void) { gpr_thd_id thread_ids[GPR_ARRAY_SIZE(tags)]; struct thread_state thread_states[GPR_ARRAY_SIZE(tags)]; gpr_thd_options thread_options = gpr_thd_options_default(); - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + grpc_core::ExecCtx exec_ctx; unsigned i, j; LOG_TEST("test_too_many_plucks"); @@ -96,7 +95,8 @@ static void test_too_many_plucks(void) { } thread_states[i].cc = cc; thread_states[i].tag = tags[i]; - gpr_thd_new(thread_ids + i, pluck_one, thread_states + i, &thread_options); + gpr_thd_new(thread_ids + i, "grpc_pluck_test", pluck_one, thread_states + i, + &thread_options); } /* wait until all other threads are plucking */ @@ -108,8 +108,8 @@ static void test_too_many_plucks(void) { for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { GPR_ASSERT(grpc_cq_begin_op(cc, tags[i])); - grpc_cq_end_op(&exec_ctx, cc, tags[i], GRPC_ERROR_NONE, - do_nothing_end_completion, nullptr, &completions[i]); + grpc_cq_end_op(cc, tags[i], GRPC_ERROR_NONE, do_nothing_end_completion, + nullptr, &completions[i]); } for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { @@ -117,7 +117,6 @@ static void test_too_many_plucks(void) { } shutdown_and_destroy(cc); - grpc_exec_ctx_finish(&exec_ctx); } #define TEST_THREAD_EVENTS 10000 @@ -137,15 +136,13 @@ gpr_timespec ten_seconds_time(void) { return grpc_timeout_seconds_to_deadline(10); } -static void free_completion(grpc_exec_ctx* exec_ctx, void* arg, - grpc_cq_completion* completion) { +static void free_completion(void* arg, grpc_cq_completion* completion) { gpr_free(completion); } static void producer_thread(void* arg) { test_thread_options* opt = static_cast<test_thread_options*>(arg); int i; - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; gpr_log(GPR_INFO, "producer %d started", opt->id); gpr_event_set(&opt->on_started, (void*)(intptr_t)1); @@ -162,17 +159,16 @@ static void producer_thread(void* arg) { gpr_log(GPR_INFO, "producer %d phase 2", opt->id); for (i = 0; i < TEST_THREAD_EVENTS; i++) { - grpc_cq_end_op(&exec_ctx, opt->cc, (void*)(intptr_t)1, GRPC_ERROR_NONE, + grpc_core::ExecCtx exec_ctx; + grpc_cq_end_op(opt->cc, (void*)(intptr_t)1, GRPC_ERROR_NONE, free_completion, nullptr, static_cast<grpc_cq_completion*>( gpr_malloc(sizeof(grpc_cq_completion)))); opt->events_triggered++; - grpc_exec_ctx_finish(&exec_ctx); } gpr_log(GPR_INFO, "producer %d phase 2 done", opt->id); gpr_event_set(&opt->on_finished, (void*)(intptr_t)1); - grpc_exec_ctx_finish(&exec_ctx); } static void consumer_thread(void* arg) { @@ -234,6 +230,7 @@ static void test_threading(size_t producers, size_t consumers) { options[i].cc = cc; options[i].id = optid++; GPR_ASSERT(gpr_thd_new(&id, + i < producers ? "grpc_producer" : "grpc_consumer", i < producers ? producer_thread : consumer_thread, options + i, nullptr)); gpr_event_wait(&options[i].on_started, ten_seconds_time()); diff --git a/test/core/surface/concurrent_connectivity_test.cc b/test/core/surface/concurrent_connectivity_test.cc index c7611b0dd1..235d136376 100644 --- a/test/core/surface/concurrent_connectivity_test.cc +++ b/test/core/surface/concurrent_connectivity_test.cc @@ -103,29 +103,28 @@ void server_thread(void* vargs) { GPR_ASSERT(detag(ev.tag) == 0xd1e); } -static void on_connect(grpc_exec_ctx* exec_ctx, void* vargs, grpc_endpoint* tcp, +static void on_connect(void* vargs, grpc_endpoint* tcp, grpc_pollset* accepting_pollset, grpc_tcp_server_acceptor* acceptor) { gpr_free(acceptor); struct server_thread_args* args = (struct server_thread_args*)vargs; - grpc_endpoint_shutdown(exec_ctx, tcp, + grpc_endpoint_shutdown(tcp, GRPC_ERROR_CREATE_FROM_STATIC_STRING("Connected")); - grpc_endpoint_destroy(exec_ctx, tcp); + grpc_endpoint_destroy(tcp); gpr_mu_lock(args->mu); - GRPC_LOG_IF_ERROR("pollset_kick", - grpc_pollset_kick(exec_ctx, args->pollset, nullptr)); + GRPC_LOG_IF_ERROR("pollset_kick", grpc_pollset_kick(args->pollset, nullptr)); gpr_mu_unlock(args->mu); } void bad_server_thread(void* vargs) { struct server_thread_args* args = (struct server_thread_args*)vargs; - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + grpc_core::ExecCtx exec_ctx; grpc_resolved_address resolved_addr; struct sockaddr_storage* addr = (struct sockaddr_storage*)resolved_addr.addr; int port; grpc_tcp_server* s; - grpc_error* error = grpc_tcp_server_create(&exec_ctx, nullptr, nullptr, &s); + grpc_error* error = grpc_tcp_server_create(nullptr, nullptr, &s); GPR_ASSERT(error == GRPC_ERROR_NONE); memset(&resolved_addr, 0, sizeof(resolved_addr)); addr->ss_family = AF_INET; @@ -134,35 +133,32 @@ void bad_server_thread(void* vargs) { GPR_ASSERT(port > 0); gpr_asprintf(&args->addr, "localhost:%d", port); - grpc_tcp_server_start(&exec_ctx, s, &args->pollset, 1, on_connect, args); + grpc_tcp_server_start(s, &args->pollset, 1, on_connect, args); gpr_event_set(&args->ready, (void*)1); gpr_mu_lock(args->mu); while (gpr_atm_acq_load(&args->stop) == 0) { - grpc_millis deadline = grpc_exec_ctx_now(&exec_ctx) + 100; + grpc_millis deadline = grpc_core::ExecCtx::Get()->Now() + 100; grpc_pollset_worker* worker = nullptr; if (!GRPC_LOG_IF_ERROR( "pollset_work", - grpc_pollset_work(&exec_ctx, args->pollset, &worker, deadline))) { + grpc_pollset_work(args->pollset, &worker, deadline))) { gpr_atm_rel_store(&args->stop, 1); } gpr_mu_unlock(args->mu); - grpc_exec_ctx_finish(&exec_ctx); + gpr_mu_lock(args->mu); } gpr_mu_unlock(args->mu); - grpc_tcp_server_unref(&exec_ctx, s); - - grpc_exec_ctx_finish(&exec_ctx); + grpc_tcp_server_unref(s); gpr_free(args->addr); } -static void done_pollset_shutdown(grpc_exec_ctx* exec_ctx, void* pollset, - grpc_error* error) { - grpc_pollset_destroy(exec_ctx, static_cast<grpc_pollset*>(pollset)); +static void done_pollset_shutdown(void* pollset, grpc_error* error) { + grpc_pollset_destroy(static_cast<grpc_pollset*>(pollset)); gpr_free(pollset); } @@ -182,7 +178,8 @@ int run_concurrent_connectivity_test() { /* First round, no server */ gpr_log(GPR_DEBUG, "Wave 1"); for (size_t i = 0; i < NUM_THREADS; ++i) { - gpr_thd_new(&threads[i], create_loop_destroy, localhost, &options); + gpr_thd_new(&threads[i], "grpc_wave_1", create_loop_destroy, localhost, + &options); } for (size_t i = 0; i < NUM_THREADS; ++i) { gpr_thd_join(threads[i]); @@ -198,10 +195,11 @@ int run_concurrent_connectivity_test() { args.cq = grpc_completion_queue_create_for_next(nullptr); grpc_server_register_completion_queue(args.server, args.cq, nullptr); grpc_server_start(args.server); - gpr_thd_new(&server, server_thread, &args, &options); + gpr_thd_new(&server, "grpc_wave_2_server", server_thread, &args, &options); for (size_t i = 0; i < NUM_THREADS; ++i) { - gpr_thd_new(&threads[i], create_loop_destroy, args.addr, &options); + gpr_thd_new(&threads[i], "grpc_wave_2", create_loop_destroy, args.addr, + &options); } for (size_t i = 0; i < NUM_THREADS; ++i) { gpr_thd_join(threads[i]); @@ -218,11 +216,13 @@ int run_concurrent_connectivity_test() { args.pollset = static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size())); grpc_pollset_init(args.pollset, &args.mu); gpr_event_init(&args.ready); - gpr_thd_new(&server, bad_server_thread, &args, &options); + gpr_thd_new(&server, "grpc_wave_3_server", bad_server_thread, &args, + &options); gpr_event_wait(&args.ready, gpr_inf_future(GPR_CLOCK_MONOTONIC)); for (size_t i = 0; i < NUM_THREADS; ++i) { - gpr_thd_new(&threads[i], create_loop_destroy, args.addr, &options); + gpr_thd_new(&threads[i], "grpc_wave_3", create_loop_destroy, args.addr, + &options); } for (size_t i = 0; i < NUM_THREADS; ++i) { gpr_thd_join(threads[i]); @@ -230,11 +230,12 @@ int run_concurrent_connectivity_test() { gpr_atm_rel_store(&args.stop, 1); gpr_thd_join(server); - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_pollset_shutdown(&exec_ctx, args.pollset, - GRPC_CLOSURE_CREATE(done_pollset_shutdown, args.pollset, - grpc_schedule_on_exec_ctx)); - grpc_exec_ctx_finish(&exec_ctx); + { + grpc_core::ExecCtx exec_ctx; + grpc_pollset_shutdown( + args.pollset, GRPC_CLOSURE_CREATE(done_pollset_shutdown, args.pollset, + grpc_schedule_on_exec_ctx)); + } grpc_shutdown(); return 0; @@ -280,7 +281,8 @@ int run_concurrent_watches_with_short_timeouts_test() { gpr_thd_options_set_joinable(&options); for (size_t i = 0; i < NUM_THREADS; ++i) { - gpr_thd_new(&threads[i], watches_with_short_timeouts, localhost, &options); + gpr_thd_new(&threads[i], "grpc_short_watches", watches_with_short_timeouts, + localhost, &options); } for (size_t i = 0; i < NUM_THREADS; ++i) { gpr_thd_join(threads[i]); diff --git a/test/core/surface/lame_client_test.cc b/test/core/surface/lame_client_test.cc index f3df7f35a7..4bf40569e6 100644 --- a/test/core/surface/lame_client_test.cc +++ b/test/core/surface/lame_client_test.cc @@ -32,20 +32,19 @@ grpc_closure transport_op_cb; static void* tag(intptr_t x) { return (void*)x; } -void verify_connectivity(grpc_exec_ctx* exec_ctx, void* arg, - grpc_error* error) { +void verify_connectivity(void* arg, grpc_error* error) { grpc_connectivity_state* state = static_cast<grpc_connectivity_state*>(arg); GPR_ASSERT(GRPC_CHANNEL_SHUTDOWN == *state); GPR_ASSERT(error == GRPC_ERROR_NONE); } -void do_nothing(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {} +void do_nothing(void* arg, grpc_error* error) {} void test_transport_op(grpc_channel* channel) { grpc_transport_op* op; grpc_channel_element* elem; grpc_connectivity_state state = GRPC_CHANNEL_IDLE; - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + grpc_core::ExecCtx exec_ctx; GRPC_CLOSURE_INIT(&transport_op_cb, verify_connectivity, &state, grpc_schedule_on_exec_ctx); @@ -54,14 +53,12 @@ void test_transport_op(grpc_channel* channel) { op->on_connectivity_state_change = &transport_op_cb; op->connectivity_state = &state; elem = grpc_channel_stack_element(grpc_channel_get_channel_stack(channel), 0); - elem->filter->start_transport_op(&exec_ctx, elem, op); - grpc_exec_ctx_finish(&exec_ctx); + elem->filter->start_transport_op(elem, op); GRPC_CLOSURE_INIT(&transport_op_cb, do_nothing, nullptr, grpc_schedule_on_exec_ctx); op = grpc_make_transport_op(&transport_op_cb); - elem->filter->start_transport_op(&exec_ctx, elem, op); - grpc_exec_ctx_finish(&exec_ctx); + elem->filter->start_transport_op(elem, op); } int main(int argc, char** argv) { diff --git a/test/core/surface/num_external_connectivity_watchers_test.cc b/test/core/surface/num_external_connectivity_watchers_test.cc index f78d333673..9cdd299ae3 100644 --- a/test/core/surface/num_external_connectivity_watchers_test.cc +++ b/test/core/surface/num_external_connectivity_watchers_test.cc @@ -178,9 +178,8 @@ static grpc_channel* secure_test_create_channel(const char* addr) { grpc_channel* channel = grpc_secure_channel_create(ssl_creds, addr, new_client_args, nullptr); { - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_channel_args_destroy(&exec_ctx, new_client_args); - grpc_exec_ctx_finish(&exec_ctx); + grpc_core::ExecCtx exec_ctx; + grpc_channel_args_destroy(new_client_args); } grpc_channel_credentials_release(ssl_creds); return channel; diff --git a/test/core/surface/secure_channel_create_test.cc b/test/core/surface/secure_channel_create_test.cc index c31c61430c..fa22cd6873 100644 --- a/test/core/surface/secure_channel_create_test.cc +++ b/test/core/surface/secure_channel_create_test.cc @@ -37,10 +37,9 @@ void test_unknown_scheme_target(void) { grpc_channel_element* elem = grpc_channel_stack_element(grpc_channel_get_channel_stack(chan), 0); GPR_ASSERT(0 == strcmp(elem->filter->name, "lame-client")); - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - GRPC_CHANNEL_INTERNAL_UNREF(&exec_ctx, chan, "test"); - grpc_channel_credentials_unref(&exec_ctx, creds); - grpc_exec_ctx_finish(&exec_ctx); + grpc_core::ExecCtx exec_ctx; + GRPC_CHANNEL_INTERNAL_UNREF(chan, "test"); + grpc_channel_credentials_unref(creds); } void test_security_connector_already_in_arg(void) { @@ -56,9 +55,8 @@ void test_security_connector_already_in_arg(void) { grpc_channel_element* elem = grpc_channel_stack_element(grpc_channel_get_channel_stack(chan), 0); GPR_ASSERT(0 == strcmp(elem->filter->name, "lame-client")); - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - GRPC_CHANNEL_INTERNAL_UNREF(&exec_ctx, chan, "test"); - grpc_exec_ctx_finish(&exec_ctx); + grpc_core::ExecCtx exec_ctx; + GRPC_CHANNEL_INTERNAL_UNREF(chan, "test"); } void test_null_creds(void) { @@ -67,9 +65,8 @@ void test_null_creds(void) { grpc_channel_element* elem = grpc_channel_stack_element(grpc_channel_get_channel_stack(chan), 0); GPR_ASSERT(0 == strcmp(elem->filter->name, "lame-client")); - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - GRPC_CHANNEL_INTERNAL_UNREF(&exec_ctx, chan, "test"); - grpc_exec_ctx_finish(&exec_ctx); + grpc_core::ExecCtx exec_ctx; + GRPC_CHANNEL_INTERNAL_UNREF(chan, "test"); } int main(int argc, char** argv) { diff --git a/test/core/surface/sequential_connectivity_test.cc b/test/core/surface/sequential_connectivity_test.cc index 015db92cb0..ac49bd9823 100644 --- a/test/core/surface/sequential_connectivity_test.cc +++ b/test/core/surface/sequential_connectivity_test.cc @@ -70,7 +70,7 @@ static void run_test(const test_fixture* fixture) { gpr_thd_id server_thread; gpr_thd_options thdopt = gpr_thd_options_default(); gpr_thd_options_set_joinable(&thdopt); - gpr_thd_new(&server_thread, server_thread_func, &sta, &thdopt); + gpr_thd_new(&server_thread, "grpc_server", server_thread_func, &sta, &thdopt); grpc_completion_queue* cq = grpc_completion_queue_create_for_next(nullptr); grpc_channel* channels[NUM_CONNECTIONS]; @@ -156,9 +156,8 @@ static grpc_channel* secure_test_create_channel(const char* addr) { grpc_channel* channel = grpc_secure_channel_create(ssl_creds, addr, new_client_args, nullptr); { - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_channel_args_destroy(&exec_ctx, new_client_args); - grpc_exec_ctx_finish(&exec_ctx); + grpc_core::ExecCtx exec_ctx; + grpc_channel_args_destroy(new_client_args); } grpc_channel_credentials_release(ssl_creds); return channel; |