aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/bad_ssl
diff options
context:
space:
mode:
authorGravatar Sree Kuchibhotla <sreek@google.com>2017-02-27 11:25:28 -0800
committerGravatar Sree Kuchibhotla <sreek@google.com>2017-03-02 13:03:30 -0800
commit321881d07f7806601bbf6d7929f4e4e58bc1e913 (patch)
tree0ca35b2f1f787af538c5c3ac88b8f1a2a7a00ebb /test/core/bad_ssl
parent7a4e5b427ccfdef78a170c9e9ba7f04e1f59b0fe (diff)
Change Core to use the new completion_queue_create API
Diffstat (limited to 'test/core/bad_ssl')
-rw-r--r--test/core/bad_ssl/bad_ssl_test.c3
-rw-r--r--test/core/bad_ssl/server_common.c22
2 files changed, 17 insertions, 8 deletions
diff --git a/test/core/bad_ssl/bad_ssl_test.c b/test/core/bad_ssl/bad_ssl_test.c
index bd85585706..4d34f8a9ea 100644
--- a/test/core/bad_ssl/bad_ssl_test.c
+++ b/test/core/bad_ssl/bad_ssl_test.c
@@ -61,7 +61,8 @@ static void run_test(const char *target, size_t nops) {
grpc_status_code status;
grpc_call_error error;
gpr_timespec deadline = grpc_timeout_seconds_to_deadline(5);
- grpc_completion_queue *cq = grpc_completion_queue_create(NULL);
+ grpc_completion_queue *cq =
+ grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL);
cq_verifier *cqv = cq_verifier_create(cq);
grpc_op ops[6];
diff --git a/test/core/bad_ssl/server_common.c b/test/core/bad_ssl/server_common.c
index 6a4313eafd..383899d94a 100644
--- a/test/core/bad_ssl/server_common.c
+++ b/test/core/bad_ssl/server_common.c
@@ -66,7 +66,10 @@ void bad_ssl_run(grpc_server *server) {
grpc_call *s = NULL;
grpc_call_details call_details;
grpc_metadata_array request_metadata_recv;
- grpc_completion_queue *cq = grpc_completion_queue_create(NULL);
+
+ grpc_completion_queue *cq =
+ grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL);
+ grpc_completion_queue *shutdown_cq;
grpc_call_details_init(&call_details);
grpc_metadata_array_init(&request_metadata_recv);
@@ -82,16 +85,21 @@ void bad_ssl_run(grpc_server *server) {
while (!shutdown_finished) {
if (got_sigint && !shutdown_started) {
gpr_log(GPR_INFO, "Shutting down due to SIGINT");
- grpc_server_shutdown_and_notify(server, cq, NULL);
- GPR_ASSERT(grpc_completion_queue_pluck(
- cq, NULL, grpc_timeout_seconds_to_deadline(5), NULL)
- .type == GRPC_OP_COMPLETE);
+ shutdown_cq =
+ grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL);
+ grpc_server_shutdown_and_notify(server, shutdown_cq, NULL);
+ GPR_ASSERT(
+ grpc_completion_queue_pluck(shutdown_cq, NULL,
+ grpc_timeout_seconds_to_deadline(5), NULL)
+ .type == GRPC_OP_COMPLETE);
+ grpc_completion_queue_destroy(shutdown_cq);
grpc_completion_queue_shutdown(cq);
shutdown_started = 1;
}
ev = grpc_completion_queue_next(
- cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
- gpr_time_from_micros(1000000, GPR_TIMESPAN)),
+ cq,
+ gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
+ gpr_time_from_micros(1000000, GPR_TIMESPAN)),
NULL);
switch (ev.type) {
case GRPC_OP_COMPLETE: