aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/end2end/tests/cancel_in_a_vacuum.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/end2end/tests/cancel_in_a_vacuum.c')
-rw-r--r--test/core/end2end/tests/cancel_in_a_vacuum.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/core/end2end/tests/cancel_in_a_vacuum.c b/test/core/end2end/tests/cancel_in_a_vacuum.c
index f0984cb5dc..7c864016b8 100644
--- a/test/core/end2end/tests/cancel_in_a_vacuum.c
+++ b/test/core/end2end/tests/cancel_in_a_vacuum.c
@@ -46,6 +46,8 @@
enum { TIMEOUT = 200000 };
+static void *tag(gpr_intptr t) { return (void *)t; }
+
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
const char *test_name,
grpc_channel_args *client_args,
@@ -73,7 +75,8 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown(f->server);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -88,12 +91,9 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
/* Cancel and do nothing */
@@ -102,9 +102,9 @@ static void test_cancel_in_a_vacuum(grpc_end2end_test_config config,
grpc_call *c;
grpc_end2end_test_fixture f = begin_test(config, "test_cancel_in_a_vacuum", NULL, NULL);
gpr_timespec deadline = five_seconds_time();
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
+ cq_verifier *v_client = cq_verifier_create(f.cq);
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
+ c = grpc_channel_create_call(f.client, f.cq, "/foo",
"foo.test.google.fr", deadline);
GPR_ASSERT(c);