aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/surface
diff options
context:
space:
mode:
authorGravatar Sree Kuchibhotla <sreek@google.com>2017-03-02 13:15:39 -0800
committerGravatar Sree Kuchibhotla <sreek@google.com>2017-03-02 13:15:39 -0800
commit4f31f44f344bdb1da1429db830989a3aced27b8a (patch)
tree8a24e5c593d97a5b0a92443344d4e19981fc60b8 /test/core/surface
parent0393d5d0a6f3567fd9f38580ae2651ceade7dfcc (diff)
rebase with latest master
Diffstat (limited to 'test/core/surface')
-rw-r--r--test/core/surface/completion_queue_test.c19
-rw-r--r--test/core/surface/completion_queue_threading_test.c5
2 files changed, 11 insertions, 13 deletions
diff --git a/test/core/surface/completion_queue_test.c b/test/core/surface/completion_queue_test.c
index 6d913cc932..f76074f207 100644
--- a/test/core/surface/completion_queue_test.c
+++ b/test/core/surface/completion_queue_test.c
@@ -106,16 +106,19 @@ static void test_pollset_conversion(void) {
}
static void test_wait_empty(void) {
- grpc_cq_polling_type polling_types[] = {DEFAULT_POLLING, NON_LISTENING};
+ grpc_cq_polling_type polling_types[] = {DEFAULT_POLLING, NON_LISTENING,
+ NON_POLLING};
grpc_completion_queue *cc;
grpc_event event;
LOG_TEST("test_wait_empty");
- cc = grpc_completion_queue_create(NULL);
- event = grpc_completion_queue_next(cc, gpr_now(GPR_CLOCK_REALTIME), NULL);
- GPR_ASSERT(event.type == GRPC_QUEUE_TIMEOUT);
- shutdown_and_destroy(cc);
+ for (size_t i = 0; i < GPR_ARRAY_SIZE(polling_types); i++) {
+ cc = grpc_completion_queue_create(GRPC_CQ_NEXT, polling_types[i], NULL);
+ event = grpc_completion_queue_next(cc, gpr_now(GPR_CLOCK_REALTIME), NULL);
+ GPR_ASSERT(event.type == GRPC_QUEUE_TIMEOUT);
+ shutdown_and_destroy(cc);
+ }
}
static void do_nothing_end_completion(grpc_exec_ctx *exec_ctx, void *arg,
@@ -263,12 +266,6 @@ struct thread_state {
void *tag;
};
-static void pluck_one(void *arg) {
- struct thread_state *state = arg;
- grpc_completion_queue_pluck(state->cc, state->tag,
- gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-}
-
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
grpc_init();
diff --git a/test/core/surface/completion_queue_threading_test.c b/test/core/surface/completion_queue_threading_test.c
index 2d55ead843..0945597284 100644
--- a/test/core/surface/completion_queue_threading_test.c
+++ b/test/core/surface/completion_queue_threading_test.c
@@ -84,7 +84,7 @@ static void test_too_many_plucks(void) {
LOG_TEST("test_too_many_plucks");
- cc = grpc_completion_queue_create(NULL);
+ cc = grpc_completion_queue_create(GRPC_CQ_PLUCK, DEFAULT_POLLING, NULL);
gpr_thd_options_set_joinable(&thread_options);
for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) {
@@ -210,7 +210,8 @@ static void test_threading(size_t producers, size_t consumers) {
gpr_malloc((producers + consumers) * sizeof(test_thread_options));
gpr_event phase1 = GPR_EVENT_INIT;
gpr_event phase2 = GPR_EVENT_INIT;
- grpc_completion_queue *cc = grpc_completion_queue_create(NULL);
+ grpc_completion_queue *cc =
+ grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL);
size_t i;
size_t total_consumed = 0;
static int optid = 101;