diff options
author | Yash Tibrewal <yashkt@google.com> | 2017-11-13 15:37:58 -0800 |
---|---|---|
committer | Yash Tibrewal <yashkt@google.com> | 2017-11-14 01:36:28 -0800 |
commit | 75122c23578e24417dcf64081c737571a9fc2dbc (patch) | |
tree | f4b8491964ec0508a5826490628c9f87b82c3326 /test/core/client_channel/resolvers | |
parent | 36cd68f0d543b9024c84eff82319890a791de7f6 (diff) |
Address some PR comments
Diffstat (limited to 'test/core/client_channel/resolvers')
4 files changed, 7 insertions, 14 deletions
diff --git a/test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc b/test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc index e2823a4501..c7a0e029f2 100644 --- a/test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc +++ b/test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc @@ -106,7 +106,6 @@ static bool wait_loop(int deadline_seconds, gpr_event* ev) { ExecCtx _local_exec_ctx; grpc_timer_check(NULL); - grpc_exec_ctx_finish(); } return false; } @@ -154,7 +153,7 @@ int main(int argc, char** argv) { call_resolver_next_after_locking( resolver, &result, GRPC_CLOSURE_CREATE(on_done, &ev1, grpc_schedule_on_exec_ctx)); - grpc_exec_ctx_flush(); + ExecCtx::Get()->Flush(); GPR_ASSERT(wait_loop(5, &ev1)); GPR_ASSERT(result == NULL); @@ -163,14 +162,13 @@ int main(int argc, char** argv) { call_resolver_next_after_locking( resolver, &result, GRPC_CLOSURE_CREATE(on_done, &ev2, grpc_schedule_on_exec_ctx)); - grpc_exec_ctx_flush(); + ExecCtx::Get()->Flush(); GPR_ASSERT(wait_loop(30, &ev2)); GPR_ASSERT(result != NULL); grpc_channel_args_destroy(result); GRPC_RESOLVER_UNREF(resolver, "test"); GRPC_COMBINER_UNREF(g_combiner, "test"); - grpc_exec_ctx_finish(); grpc_shutdown(); gpr_mu_destroy(&g_mu); diff --git a/test/core/client_channel/resolvers/dns_resolver_test.cc b/test/core/client_channel/resolvers/dns_resolver_test.cc index 8b40360263..33916b59ec 100644 --- a/test/core/client_channel/resolvers/dns_resolver_test.cc +++ b/test/core/client_channel/resolvers/dns_resolver_test.cc @@ -42,7 +42,6 @@ static void test_succeeds(grpc_resolver_factory* factory, const char* string) { GPR_ASSERT(resolver != NULL); GRPC_RESOLVER_UNREF(resolver, "test_succeeds"); grpc_uri_destroy(uri); - grpc_exec_ctx_finish(); } static void test_fails(grpc_resolver_factory* factory, const char* string) { @@ -59,7 +58,6 @@ static void test_fails(grpc_resolver_factory* factory, const char* string) { resolver = grpc_resolver_factory_create_resolver(factory, &args); GPR_ASSERT(resolver == NULL); grpc_uri_destroy(uri); - grpc_exec_ctx_finish(); } int main(int argc, char** argv) { @@ -84,7 +82,6 @@ int main(int argc, char** argv) { { ExecCtx _local_exec_ctx; GRPC_COMBINER_UNREF(g_combiner, "test"); - grpc_exec_ctx_finish(); } grpc_shutdown(); diff --git a/test/core/client_channel/resolvers/fake_resolver_test.cc b/test/core/client_channel/resolvers/fake_resolver_test.cc index ec49558f87..9a1971561c 100644 --- a/test/core/client_channel/resolvers/fake_resolver_test.cc +++ b/test/core/client_channel/resolvers/fake_resolver_test.cc @@ -109,7 +109,7 @@ static void test_fake_resolver() { results); grpc_resolver_next_locked(resolver, &on_res_arg.resolver_result, on_resolution); - grpc_exec_ctx_flush(); + ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&on_res_arg.ev, grpc_timeout_seconds_to_deadline(5)) != NULL); @@ -144,7 +144,7 @@ static void test_fake_resolver() { results_update); grpc_resolver_next_locked(resolver, &on_res_arg_update.resolver_result, on_resolution); - grpc_exec_ctx_flush(); + ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&on_res_arg_update.ev, grpc_timeout_seconds_to_deadline(5)) != NULL); @@ -153,14 +153,14 @@ static void test_fake_resolver() { memset(&on_res_arg, 0, sizeof(on_res_arg)); grpc_resolver_next_locked(resolver, &on_res_arg.resolver_result, on_resolution); - grpc_exec_ctx_flush(); + ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&on_res_arg.ev, grpc_timeout_milliseconds_to_deadline(100)) == NULL); GRPC_COMBINER_UNREF(combiner, "test_fake_resolver"); GRPC_RESOLVER_UNREF(resolver, "test_fake_resolver"); - grpc_exec_ctx_finish(); + grpc_fake_resolver_response_generator_unref(response_generator); } diff --git a/test/core/client_channel/resolvers/sockaddr_resolver_test.cc b/test/core/client_channel/resolvers/sockaddr_resolver_test.cc index dbc8a965d5..70b3cbf5b7 100644 --- a/test/core/client_channel/resolvers/sockaddr_resolver_test.cc +++ b/test/core/client_channel/resolvers/sockaddr_resolver_test.cc @@ -63,7 +63,7 @@ static void test_succeeds(grpc_resolver_factory* factory, const char* string) { grpc_resolver_next_locked(resolver, &on_res_arg.resolver_result, on_resolution); GRPC_RESOLVER_UNREF(resolver, "test_succeeds"); - grpc_exec_ctx_finish(); + grpc_uri_destroy(uri); } @@ -81,7 +81,6 @@ static void test_fails(grpc_resolver_factory* factory, const char* string) { resolver = grpc_resolver_factory_create_resolver(factory, &args); GPR_ASSERT(resolver == NULL); grpc_uri_destroy(uri); - grpc_exec_ctx_finish(); } int main(int argc, char** argv) { @@ -114,7 +113,6 @@ int main(int argc, char** argv) { { ExecCtx _local_exec_ctx; GRPC_COMBINER_UNREF(g_combiner, "test"); - grpc_exec_ctx_finish(); } grpc_shutdown(); |