aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core
diff options
context:
space:
mode:
authorGravatar David Garcia Quintas <dgq@google.com>2016-04-18 16:25:17 -0700
committerGravatar David Garcia Quintas <dgq@google.com>2016-04-18 17:39:48 -0700
commit4afce7e66ff9ea3d3118a386442cb9d2577e1926 (patch)
tree5d107befbf742dc5b477d3f870548b1a29ce2896 /test/core
parent279681311f61b079a720b7aef424cbe9000d08e8 (diff)
Changes across the board from pollset to pollset_set
Diffstat (limited to 'test/core')
-rw-r--r--test/core/channel/channel_stack_test.c23
-rw-r--r--test/core/end2end/tests/filter_causes_close.c2
-rw-r--r--test/core/http/httpcli_test.c9
-rw-r--r--test/core/http/httpscli_test.c10
-rw-r--r--test/core/security/oauth2_utils.c10
-rw-r--r--test/core/security/print_google_default_creds_token.c6
-rw-r--r--test/core/util/port_server_client.c14
7 files changed, 49 insertions, 25 deletions
diff --git a/test/core/channel/channel_stack_test.c b/test/core/channel/channel_stack_test.c
index 81e3927a00..34180ed279 100644
--- a/test/core/channel/channel_stack_test.c
+++ b/test/core/channel/channel_stack_test.c
@@ -92,17 +92,18 @@ static void free_call(grpc_exec_ctx *exec_ctx, void *arg, bool success) {
}
static void test_create_channel_stack(void) {
- const grpc_channel_filter filter = {call_func,
- channel_func,
- sizeof(int),
- call_init_func,
- grpc_call_stack_ignore_set_pollset,
- call_destroy_func,
- sizeof(int),
- channel_init_func,
- channel_destroy_func,
- get_peer,
- "some_test_filter"};
+ const grpc_channel_filter filter = {
+ call_func,
+ channel_func,
+ sizeof(int),
+ call_init_func,
+ grpc_call_stack_ignore_set_pollset_or_pollset_set,
+ call_destroy_func,
+ sizeof(int),
+ channel_init_func,
+ channel_destroy_func,
+ get_peer,
+ "some_test_filter"};
const grpc_channel_filter *filters = &filter;
grpc_channel_stack *channel_stack;
grpc_call_stack *call_stack;
diff --git a/test/core/end2end/tests/filter_causes_close.c b/test/core/end2end/tests/filter_causes_close.c
index e74d3239de..002ddf77ec 100644
--- a/test/core/end2end/tests/filter_causes_close.c
+++ b/test/core/end2end/tests/filter_causes_close.c
@@ -250,7 +250,7 @@ static const grpc_channel_filter test_filter = {
grpc_channel_next_op,
sizeof(call_data),
init_call_elem,
- grpc_call_stack_ignore_set_pollset,
+ grpc_call_stack_ignore_set_pollset_or_pollset_set,
destroy_call_elem,
sizeof(channel_data),
init_channel_elem,
diff --git a/test/core/http/httpcli_test.c b/test/core/http/httpcli_test.c
index d3a68d0eb8..36e43b8de8 100644
--- a/test/core/http/httpcli_test.c
+++ b/test/core/http/httpcli_test.c
@@ -49,6 +49,7 @@ static int g_done = 0;
static grpc_httpcli_context g_context;
static gpr_mu *g_mu;
static grpc_pollset *g_pollset;
+static grpc_pollset_set *g_pollset_set;
static gpr_timespec n_seconds_time(int seconds) {
return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(seconds);
@@ -86,8 +87,8 @@ static void test_get(int port) {
req.http.path = "/get";
req.handshaker = &grpc_httpcli_plaintext;
- grpc_httpcli_get(&exec_ctx, &g_context, g_pollset, &req, n_seconds_time(15),
- on_finish, (void *)42);
+ grpc_httpcli_get(&exec_ctx, &g_context, g_pollset_set, &req,
+ n_seconds_time(15), on_finish, (void *)42);
gpr_mu_lock(g_mu);
while (!g_done) {
grpc_pollset_worker *worker = NULL;
@@ -117,7 +118,7 @@ static void test_post(int port) {
req.http.path = "/post";
req.handshaker = &grpc_httpcli_plaintext;
- grpc_httpcli_post(&exec_ctx, &g_context, g_pollset, &req, "hello", 5,
+ grpc_httpcli_post(&exec_ctx, &g_context, g_pollset_set, &req, "hello", 5,
n_seconds_time(15), on_finish, (void *)42);
gpr_mu_lock(g_mu);
while (!g_done) {
@@ -182,6 +183,8 @@ int main(int argc, char **argv) {
grpc_httpcli_context_init(&g_context);
g_pollset = gpr_malloc(grpc_pollset_size());
grpc_pollset_init(g_pollset, &g_mu);
+ g_pollset_set = grpc_pollset_set_create();
+ grpc_pollset_set_add_pollset(&exec_ctx, g_pollset_set, g_pollset);
test_get(port);
test_post(port);
diff --git a/test/core/http/httpscli_test.c b/test/core/http/httpscli_test.c
index d807336904..1aeaf2cf10 100644
--- a/test/core/http/httpscli_test.c
+++ b/test/core/http/httpscli_test.c
@@ -49,6 +49,7 @@ static int g_done = 0;
static grpc_httpcli_context g_context;
static gpr_mu *g_mu;
static grpc_pollset *g_pollset;
+static grpc_pollset_set *g_pollset_set;
static gpr_timespec n_seconds_time(int seconds) {
return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(seconds);
@@ -87,8 +88,8 @@ static void test_get(int port) {
req.http.path = "/get";
req.handshaker = &grpc_httpcli_ssl;
- grpc_httpcli_get(&exec_ctx, &g_context, g_pollset, &req, n_seconds_time(15),
- on_finish, (void *)42);
+ grpc_httpcli_get(&exec_ctx, &g_context, g_pollset_set, &req,
+ n_seconds_time(15), on_finish, (void *)42);
gpr_mu_lock(g_mu);
while (!g_done) {
grpc_pollset_worker *worker = NULL;
@@ -119,7 +120,7 @@ static void test_post(int port) {
req.http.path = "/post";
req.handshaker = &grpc_httpcli_ssl;
- grpc_httpcli_post(&exec_ctx, &g_context, g_pollset, &req, "hello", 5,
+ grpc_httpcli_post(&exec_ctx, &g_context, g_pollset_set, &req, "hello", 5,
n_seconds_time(15), on_finish, (void *)42);
gpr_mu_lock(g_mu);
while (!g_done) {
@@ -185,6 +186,8 @@ int main(int argc, char **argv) {
grpc_httpcli_context_init(&g_context);
g_pollset = gpr_malloc(grpc_pollset_size());
grpc_pollset_init(g_pollset, &g_mu);
+ g_pollset_set = grpc_pollset_set_create();
+ grpc_pollset_set_add_pollset(&exec_ctx, g_pollset_set, g_pollset);
test_get(port);
test_post(port);
@@ -193,6 +196,7 @@ int main(int argc, char **argv) {
grpc_closure_init(&destroyed, destroy_pollset, g_pollset);
grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
grpc_exec_ctx_finish(&exec_ctx);
+ grpc_pollset_set_destroy(g_pollset_set);
grpc_shutdown();
gpr_free(g_pollset);
diff --git a/test/core/security/oauth2_utils.c b/test/core/security/oauth2_utils.c
index 20815d184c..94d35026f1 100644
--- a/test/core/security/oauth2_utils.c
+++ b/test/core/security/oauth2_utils.c
@@ -47,6 +47,7 @@
typedef struct {
gpr_mu *mu;
grpc_pollset *pollset;
+ grpc_pollset_set *pollset_set;
int is_done;
char *token;
} oauth2_request;
@@ -85,13 +86,15 @@ char *grpc_test_fetch_oauth2_token_with_credentials(
request.pollset = gpr_malloc(grpc_pollset_size());
grpc_pollset_init(request.pollset, &request.mu);
+ request.pollset_set = grpc_pollset_set_create();
+ grpc_pollset_set_add_pollset(&exec_ctx, request.pollset_set, request.pollset);
request.is_done = 0;
grpc_closure_init(&do_nothing_closure, do_nothing, NULL);
- grpc_call_credentials_get_request_metadata(&exec_ctx, creds, request.pollset,
- null_ctx, on_oauth2_response,
- &request);
+ grpc_call_credentials_get_request_metadata(&exec_ctx, creds,
+ request.pollset_set, null_ctx,
+ on_oauth2_response, &request);
grpc_exec_ctx_finish(&exec_ctx);
@@ -107,6 +110,7 @@ char *grpc_test_fetch_oauth2_token_with_credentials(
grpc_pollset_shutdown(&exec_ctx, request.pollset, &do_nothing_closure);
grpc_exec_ctx_finish(&exec_ctx);
grpc_pollset_destroy(request.pollset);
+ grpc_pollset_set_destroy(request.pollset_set);
gpr_free(request.pollset);
return request.token;
}
diff --git a/test/core/security/print_google_default_creds_token.c b/test/core/security/print_google_default_creds_token.c
index 99bce4fbdf..2c292bc80b 100644
--- a/test/core/security/print_google_default_creds_token.c
+++ b/test/core/security/print_google_default_creds_token.c
@@ -48,6 +48,7 @@
typedef struct {
gpr_mu *mu;
grpc_pollset *pollset;
+ grpc_pollset_set *pollset_set;
int is_done;
} synchronizer;
@@ -95,11 +96,13 @@ int main(int argc, char **argv) {
sync.pollset = gpr_malloc(grpc_pollset_size());
grpc_pollset_init(sync.pollset, &sync.mu);
+ sync.pollset_set = grpc_pollset_set_create();
+ grpc_pollset_set_add_pollset(&exec_ctx, sync.pollset_set, sync.pollset);
sync.is_done = 0;
grpc_call_credentials_get_request_metadata(
&exec_ctx, ((grpc_composite_channel_credentials *)creds)->call_creds,
- sync.pollset, context, on_metadata_response, &sync);
+ sync.pollset_set, context, on_metadata_response, &sync);
gpr_mu_lock(sync.mu);
while (!sync.is_done) {
@@ -116,6 +119,7 @@ int main(int argc, char **argv) {
grpc_exec_ctx_finish(&exec_ctx);
grpc_channel_credentials_release(creds);
+ grpc_pollset_set_destroy(sync.pollset_set);
gpr_free(sync.pollset);
end:
diff --git a/test/core/util/port_server_client.c b/test/core/util/port_server_client.c
index 84e90547aa..25a14f513e 100644
--- a/test/core/util/port_server_client.c
+++ b/test/core/util/port_server_client.c
@@ -52,6 +52,7 @@
typedef struct freereq {
gpr_mu *mu;
grpc_pollset *pollset;
+ grpc_pollset_set *pollset_set;
int done;
} freereq;
@@ -86,6 +87,8 @@ void grpc_free_port_using_server(char *server, int port) {
pr.pollset = gpr_malloc(grpc_pollset_size());
grpc_pollset_init(pr.pollset, &pr.mu);
+ pr.pollset_set = grpc_pollset_set_create();
+ grpc_pollset_set_add_pollset(&exec_ctx, pr.pollset_set, pr.pollset);
shutdown_closure =
grpc_closure_create(destroy_pollset_and_shutdown, pr.pollset);
@@ -94,7 +97,7 @@ void grpc_free_port_using_server(char *server, int port) {
req.http.path = path;
grpc_httpcli_context_init(&context);
- grpc_httpcli_get(&exec_ctx, &context, pr.pollset, &req,
+ grpc_httpcli_get(&exec_ctx, &context, pr.pollset_set, &req,
GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10), freed_port_from_server,
&pr);
gpr_mu_lock(pr.mu);
@@ -110,12 +113,14 @@ void grpc_free_port_using_server(char *server, int port) {
grpc_exec_ctx_finish(&exec_ctx);
grpc_pollset_shutdown(&exec_ctx, pr.pollset, shutdown_closure);
grpc_exec_ctx_finish(&exec_ctx);
+ grpc_pollset_set_destroy(pr.pollset_set);
gpr_free(path);
}
typedef struct portreq {
gpr_mu *mu;
grpc_pollset *pollset;
+ grpc_pollset_set *pollset_set;
int port;
int retries;
char *server;
@@ -151,7 +156,7 @@ static void got_port_from_server(grpc_exec_ctx *exec_ctx, void *arg,
pr->retries++;
req.host = pr->server;
req.http.path = "/get";
- grpc_httpcli_get(exec_ctx, pr->ctx, pr->pollset, &req,
+ grpc_httpcli_get(exec_ctx, pr->ctx, pr->pollset_set, &req,
GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10), got_port_from_server,
pr);
return;
@@ -182,6 +187,8 @@ int grpc_pick_port_using_server(char *server) {
memset(&req, 0, sizeof(req));
pr.pollset = gpr_malloc(grpc_pollset_size());
grpc_pollset_init(pr.pollset, &pr.mu);
+ pr.pollset_set = grpc_pollset_set_create();
+ grpc_pollset_set_add_pollset(&exec_ctx, pr.pollset_set, pr.pollset);
shutdown_closure =
grpc_closure_create(destroy_pollset_and_shutdown, pr.pollset);
pr.port = -1;
@@ -192,7 +199,7 @@ int grpc_pick_port_using_server(char *server) {
req.http.path = "/get";
grpc_httpcli_context_init(&context);
- grpc_httpcli_get(&exec_ctx, &context, pr.pollset, &req,
+ grpc_httpcli_get(&exec_ctx, &context, pr.pollset_set, &req,
GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10), got_port_from_server,
&pr);
grpc_exec_ctx_finish(&exec_ctx);
@@ -208,6 +215,7 @@ int grpc_pick_port_using_server(char *server) {
grpc_httpcli_context_destroy(&context);
grpc_pollset_shutdown(&exec_ctx, pr.pollset, shutdown_closure);
grpc_exec_ctx_finish(&exec_ctx);
+ grpc_pollset_set_destroy(pr.pollset_set);
return pr.port;
}