aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/client_channel
diff options
context:
space:
mode:
authorGravatar Yash Tibrewal <yashkt@google.com>2017-11-13 15:37:58 -0800
committerGravatar Yash Tibrewal <yashkt@google.com>2017-11-14 01:36:28 -0800
commit75122c23578e24417dcf64081c737571a9fc2dbc (patch)
treef4b8491964ec0508a5826490628c9f87b82c3326 /test/core/client_channel
parent36cd68f0d543b9024c84eff82319890a791de7f6 (diff)
Address some PR comments
Diffstat (limited to 'test/core/client_channel')
-rw-r--r--test/core/client_channel/lb_policies_test.cc2
-rw-r--r--test/core/client_channel/parse_address_test.cc3
-rw-r--r--test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc6
-rw-r--r--test/core/client_channel/resolvers/dns_resolver_test.cc3
-rw-r--r--test/core/client_channel/resolvers/fake_resolver_test.cc8
-rw-r--r--test/core/client_channel/resolvers/sockaddr_resolver_test.cc4
-rw-r--r--test/core/client_channel/uri_fuzzer_test.cc2
-rw-r--r--test/core/client_channel/uri_parser_test.cc8
8 files changed, 11 insertions, 25 deletions
diff --git a/test/core/client_channel/lb_policies_test.cc b/test/core/client_channel/lb_policies_test.cc
index aabe8dea3c..5b412cc622 100644
--- a/test/core/client_channel/lb_policies_test.cc
+++ b/test/core/client_channel/lb_policies_test.cc
@@ -653,7 +653,6 @@ static void test_get_channel_info() {
{
ExecCtx _local_exec_ctx;
grpc_channel_args_destroy(args);
- grpc_exec_ctx_finish();
}
// Ensures that resolver returns.
grpc_channel_check_connectivity_state(channel, true /* try_to_connect */);
@@ -1025,7 +1024,6 @@ int main(int argc, char** argv) {
test_ping();
test_get_channel_info();
- grpc_exec_ctx_finish();
grpc_shutdown();
return 0;
}
diff --git a/test/core/client_channel/parse_address_test.cc b/test/core/client_channel/parse_address_test.cc
index 17725ba5ff..597a1212c1 100644
--- a/test/core/client_channel/parse_address_test.cc
+++ b/test/core/client_channel/parse_address_test.cc
@@ -43,7 +43,6 @@ static void test_grpc_parse_unix(const char* uri_text, const char* pathname) {
GPR_ASSERT(0 == strcmp(addr_un->sun_path, pathname));
grpc_uri_destroy(uri);
- grpc_exec_ctx_finish();
}
#else /* GRPC_HAVE_UNIX_SOCKET */
@@ -68,7 +67,6 @@ static void test_grpc_parse_ipv4(const char* uri_text, const char* host,
GPR_ASSERT(ntohs(addr_in->sin_port) == port);
grpc_uri_destroy(uri);
- grpc_exec_ctx_finish();
}
static void test_grpc_parse_ipv6(const char* uri_text, const char* host,
@@ -88,7 +86,6 @@ static void test_grpc_parse_ipv6(const char* uri_text, const char* host,
GPR_ASSERT(addr_in6->sin6_scope_id == scope_id);
grpc_uri_destroy(uri);
- grpc_exec_ctx_finish();
}
int main(int argc, char** argv) {
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();
diff --git a/test/core/client_channel/uri_fuzzer_test.cc b/test/core/client_channel/uri_fuzzer_test.cc
index 805becad18..6c1e8cb137 100644
--- a/test/core/client_channel/uri_fuzzer_test.cc
+++ b/test/core/client_channel/uri_fuzzer_test.cc
@@ -38,7 +38,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
if ((x = grpc_uri_parse(s, 1))) {
grpc_uri_destroy(x);
}
- grpc_exec_ctx_finish();
+
gpr_free(s);
return 0;
}
diff --git a/test/core/client_channel/uri_parser_test.cc b/test/core/client_channel/uri_parser_test.cc
index 591c642f4e..024c30faee 100644
--- a/test/core/client_channel/uri_parser_test.cc
+++ b/test/core/client_channel/uri_parser_test.cc
@@ -36,14 +36,13 @@ static void test_succeeds(const char* uri_text, const char* scheme,
GPR_ASSERT(0 == strcmp(path, uri->path));
GPR_ASSERT(0 == strcmp(query, uri->query));
GPR_ASSERT(0 == strcmp(fragment, uri->fragment));
- grpc_exec_ctx_finish();
+
grpc_uri_destroy(uri);
}
static void test_fails(const char* uri_text) {
ExecCtx _local_exec_ctx;
GPR_ASSERT(NULL == grpc_uri_parse(uri_text, 0));
- grpc_exec_ctx_finish();
}
static void test_query_parts() {
@@ -77,7 +76,7 @@ static void test_query_parts() {
GPR_ASSERT(NULL == grpc_uri_get_query_arg(uri, ""));
GPR_ASSERT(0 == strcmp("frag", uri->fragment));
- grpc_exec_ctx_finish();
+
grpc_uri_destroy(uri);
}
{
@@ -96,7 +95,6 @@ static void test_query_parts() {
GPR_ASSERT(0 == strcmp("bar", grpc_uri_get_query_arg(uri, "foo")));
GPR_ASSERT(0 == strcmp("", grpc_uri_get_query_arg(uri, "foobar")));
- grpc_exec_ctx_finish();
grpc_uri_destroy(uri);
}
{
@@ -114,7 +112,7 @@ static void test_query_parts() {
GPR_ASSERT(NULL == uri->query_parts);
GPR_ASSERT(NULL == uri->query_parts_values);
GPR_ASSERT(0 == strcmp("", uri->fragment));
- grpc_exec_ctx_finish();
+
grpc_uri_destroy(uri);
}
}