Skip to content
Snippets Groups Projects
Commit 6b45d012 authored by Sree Kuchibhotla's avatar Sree Kuchibhotla
Browse files

fix tests after rebase

parent 4f31f44f
Branches
Tags
No related merge requests found
...@@ -75,10 +75,10 @@ static void drain_cq(grpc_completion_queue *cq) { ...@@ -75,10 +75,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) { static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
GPR_ASSERT( GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
grpc_completion_queue_pluck(f->cq, tag(1000), five_seconds_time(), NULL) five_seconds_time(), NULL)
.type == GRPC_OP_COMPLETE); .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = NULL; f->server = NULL;
} }
...@@ -96,6 +96,7 @@ static void end_test(grpc_end2end_test_fixture *f) { ...@@ -96,6 +96,7 @@ static void end_test(grpc_end2end_test_fixture *f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
/* Client sends a request, server replies with a payload, then waits for the /* Client sends a request, server replies with a payload, then waits for the
......
...@@ -52,7 +52,24 @@ static void *create_test_tag(void) { ...@@ -52,7 +52,24 @@ static void *create_test_tag(void) {
static void shutdown_and_destroy(grpc_completion_queue *cc) { static void shutdown_and_destroy(grpc_completion_queue *cc) {
grpc_event ev; grpc_event ev;
grpc_completion_queue_shutdown(cc); grpc_completion_queue_shutdown(cc);
ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
switch (grpc_get_cq_completion_type(cc)) {
case GRPC_CQ_NEXT: {
ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME),
NULL);
break;
}
case GRPC_CQ_PLUCK: {
ev = grpc_completion_queue_pluck(cc, create_test_tag(),
gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
break;
}
default: {
gpr_log(GPR_ERROR, "Unknown completion type");
break;
}
}
GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN); GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN);
grpc_completion_queue_destroy(cc); grpc_completion_queue_destroy(cc);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment