rebase with latest master

reviewable/pr9972/r1
Sree Kuchibhotla 8 years ago
parent 0393d5d0a6
commit 4f31f44f34
  1. 19
      test/core/surface/completion_queue_test.c
  2. 5
      test/core/surface/completion_queue_threading_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();

@ -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;

Loading…
Cancel
Save