aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/end2end/tests/request_response_with_payload_and_call_creds.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/end2end/tests/request_response_with_payload_and_call_creds.c')
-rw-r--r--test/core/end2end/tests/request_response_with_payload_and_call_creds.c40
1 files changed, 17 insertions, 23 deletions
diff --git a/test/core/end2end/tests/request_response_with_payload_and_call_creds.c b/test/core/end2end/tests/request_response_with_payload_and_call_creds.c
index 08443f19a5..45057f07c5 100644
--- a/test/core/end2end/tests/request_response_with_payload_and_call_creds.c
+++ b/test/core/end2end/tests/request_response_with_payload_and_call_creds.c
@@ -88,7 +88,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;
}
@@ -103,12 +104,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);
}
static void print_auth_context(int is_client, const grpc_auth_context *ctx) {
@@ -133,7 +131,7 @@ static void test_call_creds_failure(grpc_end2end_test_config config) {
grpc_credentials *creds = NULL;
grpc_end2end_test_fixture f = begin_test(config, "test_call_creds_failure", NULL, NULL);
gpr_timespec deadline = five_seconds_time();
- 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);
@@ -162,8 +160,7 @@ static void request_response_with_payload_and_call_creds(
gpr_timespec deadline = five_seconds_time();
grpc_end2end_test_fixture f = begin_test(config, test_name, NULL, NULL);
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
- cq_verifier *v_server = cq_verifier_create(f.server_cq);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_op ops[6];
grpc_op *op;
grpc_metadata_array initial_metadata_recv;
@@ -179,7 +176,7 @@ static void request_response_with_payload_and_call_creds(
grpc_credentials *creds = NULL;
const grpc_auth_context *s_auth_context = NULL;
- 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);
creds = grpc_iam_credentials_create(iam_token, iam_selector);
@@ -232,10 +229,10 @@ static void request_response_with_payload_and_call_creds(
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(f.server, &s,
&call_details,
&request_metadata_recv,
- f.server_cq, f.server_cq,
+ f.cq, f.cq,
tag(101)));
- cq_expect_completion(v_server, tag(101), 1);
- cq_verify(v_server);
+ cq_expect_completion(cqv, tag(101), 1);
+ cq_verify(cqv);
s_auth_context = grpc_call_auth_context(s);
GPR_ASSERT(s_auth_context != NULL);
print_auth_context(0, s_auth_context);
@@ -252,8 +249,8 @@ static void request_response_with_payload_and_call_creds(
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102)));
- cq_expect_completion(v_server, tag(102), 1);
- cq_verify(v_server);
+ cq_expect_completion(cqv, tag(102), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
@@ -269,11 +266,9 @@ static void request_response_with_payload_and_call_creds(
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(103)));
- cq_expect_completion(v_server, tag(103), 1);
- cq_verify(v_server);
-
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(103), 1);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
GPR_ASSERT(status == GRPC_STATUS_OK);
GPR_ASSERT(0 == strcmp(details, "xyz"));
@@ -325,8 +320,7 @@ static void request_response_with_payload_and_call_creds(
grpc_call_destroy(c);
grpc_call_destroy(s);
- cq_verifier_destroy(v_client);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
grpc_byte_buffer_destroy(request_payload);
grpc_byte_buffer_destroy(response_payload);