From 9a123df2cd71e7ab465dcdcf74f89796b57908a0 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Wed, 29 Jul 2015 23:45:08 +0200 Subject: [PATCH] Fixing C/C++ tests. --- test/core/bad_client/bad_client.c | 7 +-- .../core/bad_client/tests/connection_prefix.c | 4 +- .../bad_client/tests/initial_settings_frame.c | 4 +- test/core/end2end/cq_verifier.c | 4 +- test/core/end2end/dualstack_socket_test.c | 29 +++++----- .../end2end/fixtures/chttp2_fake_security.c | 6 +-- test/core/end2end/fixtures/chttp2_fullstack.c | 8 +-- .../fixtures/chttp2_fullstack_compression.c | 9 ++-- .../fixtures/chttp2_fullstack_uds_posix.c | 8 +-- .../fixtures/chttp2_fullstack_with_poll.c | 8 +-- .../fixtures/chttp2_simple_ssl_fullstack.c | 6 +-- .../chttp2_simple_ssl_fullstack_with_poll.c | 6 +-- .../chttp2_simple_ssl_with_oauth2_fullstack.c | 6 +-- .../end2end/fixtures/chttp2_socket_pair.c | 4 +- .../chttp2_socket_pair_one_byte_at_a_time.c | 4 +- .../chttp2_socket_pair_with_grpc_trace.c | 4 +- .../end2end/multiple_server_queues_test.c | 16 +++--- test/core/end2end/no_server_test.c | 13 ++--- test/core/end2end/tests/bad_hostname.c | 11 ++-- test/core/end2end/tests/cancel_after_accept.c | 22 ++++---- .../cancel_after_accept_and_writes_closed.c | 22 ++++---- test/core/end2end/tests/cancel_after_invoke.c | 13 +++-- .../core/end2end/tests/cancel_before_invoke.c | 13 +++-- test/core/end2end/tests/cancel_in_a_vacuum.c | 9 ++-- test/core/end2end/tests/cancel_test_helpers.h | 5 +- .../end2end/tests/census_simple_request.c | 21 +++++--- test/core/end2end/tests/disappearing_server.c | 19 ++++--- ..._server_shutdown_finishes_inflight_calls.c | 18 ++++--- .../early_server_shutdown_finishes_tags.c | 2 +- test/core/end2end/tests/empty_batch.c | 11 ++-- .../end2end/tests/graceful_server_shutdown.c | 18 ++++--- .../core/end2end/tests/invoke_large_request.c | 24 +++++---- .../end2end/tests/max_concurrent_streams.c | 53 +++++++++++-------- test/core/end2end/tests/max_message_length.c | 21 +++++--- test/core/end2end/tests/no_op.c | 5 +- test/core/end2end/tests/ping_pong_streaming.c | 38 +++++++------ test/core/end2end/tests/registered_call.c | 27 ++++++---- ...esponse_with_binary_metadata_and_payload.c | 36 ++++++++----- ...quest_response_with_metadata_and_payload.c | 32 ++++++----- .../tests/request_response_with_payload.c | 24 +++++---- ...est_response_with_payload_and_call_creds.c | 26 +++++---- ...ponse_with_trailing_metadata_and_payload.c | 36 +++++++------ .../tests/request_with_compressed_payload.c | 25 +++++---- test/core/end2end/tests/request_with_flags.c | 11 ++-- .../tests/request_with_large_metadata.c | 24 +++++---- .../core/end2end/tests/request_with_payload.c | 17 +++--- .../end2end/tests/server_finishes_request.c | 21 +++++--- .../end2end/tests/simple_delayed_request.c | 22 ++++---- test/core/end2end/tests/simple_request.c | 21 +++++--- ...equest_with_high_initial_sequence_number.c | 21 +++++--- test/core/fling/client.c | 47 +++++++++------- test/core/fling/server.c | 46 +++++++++------- test/core/surface/completion_queue_test.c | 41 +++++++------- test/core/surface/lame_client_test.c | 9 ++-- 54 files changed, 563 insertions(+), 394 deletions(-) diff --git a/test/core/bad_client/bad_client.c b/test/core/bad_client/bad_client.c index b050227b61e..f7399770dd2 100644 --- a/test/core/bad_client/bad_client.c +++ b/test/core/bad_client/bad_client.c @@ -102,11 +102,11 @@ void grpc_run_bad_client_test(grpc_bad_client_server_side_validator validator, /* Create server, completion events */ a.server = grpc_server_create_from_filters(NULL, 0, NULL); - a.cq = grpc_completion_queue_create(); + a.cq = grpc_completion_queue_create(NULL); gpr_event_init(&a.done_thd); gpr_event_init(&a.done_write); a.validator = validator; - grpc_server_register_completion_queue(a.server, a.cq); + grpc_server_register_completion_queue(a.server, a.cq, NULL); grpc_server_start(a.server); transport = grpc_create_chttp2_transport(NULL, sfd.server, mdctx, 0); server_setup_transport(&a, transport, mdctx); @@ -151,7 +151,8 @@ void grpc_run_bad_client_test(grpc_bad_client_server_side_validator validator, } grpc_server_shutdown_and_notify(a.server, a.cq, NULL); GPR_ASSERT(grpc_completion_queue_pluck(a.cq, NULL, - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(a.server); grpc_completion_queue_destroy(a.cq); diff --git a/test/core/bad_client/tests/connection_prefix.c b/test/core/bad_client/tests/connection_prefix.c index 0bd86ecf55a..de62e923f02 100644 --- a/test/core/bad_client/tests/connection_prefix.c +++ b/test/core/bad_client/tests/connection_prefix.c @@ -37,8 +37,8 @@ static void verifier(grpc_server *server, grpc_completion_queue *cq) { while (grpc_server_has_open_connections(server)) { GPR_ASSERT( - grpc_completion_queue_next(cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(20)) - .type == GRPC_QUEUE_TIMEOUT); + grpc_completion_queue_next(cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(20), + NULL).type == GRPC_QUEUE_TIMEOUT); } } diff --git a/test/core/bad_client/tests/initial_settings_frame.c b/test/core/bad_client/tests/initial_settings_frame.c index 2075602e276..28e9a39dff1 100644 --- a/test/core/bad_client/tests/initial_settings_frame.c +++ b/test/core/bad_client/tests/initial_settings_frame.c @@ -39,8 +39,8 @@ static void verifier(grpc_server *server, grpc_completion_queue *cq) { while (grpc_server_has_open_connections(server)) { GPR_ASSERT( - grpc_completion_queue_next(cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(20)) - .type == GRPC_QUEUE_TIMEOUT); + grpc_completion_queue_next(cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(20), + NULL).type == GRPC_QUEUE_TIMEOUT); } } diff --git a/test/core/end2end/cq_verifier.c b/test/core/end2end/cq_verifier.c index c28932c52b4..a9ba78dfdb3 100644 --- a/test/core/end2end/cq_verifier.c +++ b/test/core/end2end/cq_verifier.c @@ -226,7 +226,7 @@ void cq_verify(cq_verifier *v) { gpr_strvec_init(&have_tags); while (v->expect.next != &v->expect) { - ev = grpc_completion_queue_next(v->cq, deadline); + ev = grpc_completion_queue_next(v->cq, deadline, NULL); if (ev.type == GRPC_QUEUE_TIMEOUT) { fail_no_event_received(v); break; @@ -265,7 +265,7 @@ void cq_verify_empty(cq_verifier *v) { GPR_ASSERT(v->expect.next == &v->expect && "expectation queue must be empty"); - ev = grpc_completion_queue_next(v->cq, deadline); + ev = grpc_completion_queue_next(v->cq, deadline, NULL); if (ev.type != GRPC_QUEUE_TIMEOUT) { char *s = grpc_event_string(&ev); gpr_log(GPR_ERROR, "unexpected event (expected nothing): %s", s); diff --git a/test/core/end2end/dualstack_socket_test.c b/test/core/end2end/dualstack_socket_test.c index 05ad42ca1f3..4cfb8db9e07 100644 --- a/test/core/end2end/dualstack_socket_test.c +++ b/test/core/end2end/dualstack_socket_test.c @@ -52,7 +52,7 @@ static gpr_timespec ms_from_now(int ms) { static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, ms_from_now(5000)); + ev = grpc_completion_queue_next(cq, ms_from_now(5000), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -74,6 +74,7 @@ void test_connect(const char *server_host, const char *client_host, int port, grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; int was_cancelled = 2; @@ -91,9 +92,9 @@ void test_connect(const char *server_host, const char *client_host, int port, grpc_call_details_init(&call_details); /* Create server. */ - cq = grpc_completion_queue_create(); - server = grpc_server_create(NULL); - grpc_server_register_completion_queue(server, cq); + cq = grpc_completion_queue_create(NULL); + server = grpc_server_create(NULL, NULL); + grpc_server_register_completion_queue(server, cq, NULL); GPR_ASSERT((got_port = grpc_server_add_http2_port(server, server_hostport)) > 0); if (port == 0) { @@ -106,7 +107,7 @@ void test_connect(const char *server_host, const char *client_host, int port, /* Create client. */ gpr_join_host_port(&client_hostport, client_host, port); - client = grpc_channel_create(client_hostport, NULL); + client = grpc_channel_create(client_hostport, NULL, NULL); gpr_log(GPR_INFO, "Testing with server=%s client=%s (expecting %s)", server_hostport, client_hostport, expect_ok ? "success" : "failure"); @@ -125,7 +126,7 @@ void test_connect(const char *server_host, const char *client_host, int port, /* Send a trivial request. */ c = grpc_channel_create_call(client, cq, "/foo", "foo.test.google.fr", - deadline); + deadline, NULL); GPR_ASSERT(c); op = ops; @@ -147,13 +148,14 @@ void test_connect(const char *server_host, const char *client_host, int port, op->data.recv_status_on_client.status_details_capacity = &details_capacity; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1))); + error = grpc_call_start_batch(c, ops, op - ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); if (expect_ok) { /* Check for a successful request. */ - GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( - server, &s, &call_details, - &request_metadata_recv, cq, cq, tag(101))); + error = grpc_server_request_call(server, &s, &call_details, + &request_metadata_recv, cq, cq, tag(101)); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); @@ -172,8 +174,8 @@ void test_connect(const char *server_host, const char *client_host, int port, op->data.recv_close_on_server.cancelled = &was_cancelled; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == - grpc_call_start_batch(s, ops, op - ops, tag(102))); + error = grpc_call_start_batch(s, ops, op - ops, tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(102), 1); cq_expect_completion(cqv, tag(1), 1); @@ -204,7 +206,8 @@ void test_connect(const char *server_host, const char *client_host, int port, /* Destroy server. */ grpc_server_shutdown_and_notify(server, cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(cq, tag(1000), - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(server); grpc_completion_queue_shutdown(cq); diff --git a/test/core/end2end/fixtures/chttp2_fake_security.c b/test/core/end2end/fixtures/chttp2_fake_security.c index f879b43f794..89d8cdc4fe2 100644 --- a/test/core/end2end/fixtures/chttp2_fake_security.c +++ b/test/core/end2end/fixtures/chttp2_fake_security.c @@ -60,7 +60,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create(); + f.cq = grpc_completion_queue_create(NULL); return f; } @@ -81,8 +81,8 @@ static void chttp2_init_server_secure_fullstack( if (f->server) { grpc_server_destroy(f->server); } - f->server = grpc_server_create(server_args); - grpc_server_register_completion_queue(f->server, f->cq); + f->server = grpc_server_create(server_args, NULL); + grpc_server_register_completion_queue(f->server, f->cq, NULL); GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr, server_creds)); grpc_server_credentials_release(server_creds); diff --git a/test/core/end2end/fixtures/chttp2_fullstack.c b/test/core/end2end/fixtures/chttp2_fullstack.c index 8a1530e63b0..705decb3466 100644 --- a/test/core/end2end/fixtures/chttp2_fullstack.c +++ b/test/core/end2end/fixtures/chttp2_fullstack.c @@ -64,7 +64,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create(); + f.cq = grpc_completion_queue_create(NULL); return f; } @@ -72,7 +72,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( void chttp2_init_client_fullstack(grpc_end2end_test_fixture *f, grpc_channel_args *client_args) { fullstack_fixture_data *ffd = f->fixture_data; - f->client = grpc_channel_create(ffd->localaddr, client_args); + f->client = grpc_channel_create(ffd->localaddr, client_args, NULL); GPR_ASSERT(f->client); } @@ -82,8 +82,8 @@ void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f, if (f->server) { grpc_server_destroy(f->server); } - f->server = grpc_server_create(server_args); - grpc_server_register_completion_queue(f->server, f->cq); + f->server = grpc_server_create(server_args, NULL); + grpc_server_register_completion_queue(f->server, f->cq, NULL); GPR_ASSERT(grpc_server_add_http2_port(f->server, ffd->localaddr)); grpc_server_start(f->server); } diff --git a/test/core/end2end/fixtures/chttp2_fullstack_compression.c b/test/core/end2end/fixtures/chttp2_fullstack_compression.c index 0a9a3122968..b8ec8f8ef97 100644 --- a/test/core/end2end/fixtures/chttp2_fullstack_compression.c +++ b/test/core/end2end/fixtures/chttp2_fullstack_compression.c @@ -69,7 +69,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack_compression( memset(&f, 0, sizeof(f)); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create(); + f.cq = grpc_completion_queue_create(NULL); return f; } @@ -82,7 +82,8 @@ void chttp2_init_client_fullstack_compression(grpc_end2end_test_fixture *f, } ffd->client_args_compression = grpc_channel_args_set_compression_algorithm( client_args, GRPC_COMPRESS_GZIP); - f->client = grpc_channel_create(ffd->localaddr, ffd->client_args_compression); + f->client = grpc_channel_create(ffd->localaddr, ffd->client_args_compression, + NULL); } void chttp2_init_server_fullstack_compression(grpc_end2end_test_fixture *f, @@ -96,8 +97,8 @@ void chttp2_init_server_fullstack_compression(grpc_end2end_test_fixture *f, if (f->server) { grpc_server_destroy(f->server); } - f->server = grpc_server_create(ffd->server_args_compression); - grpc_server_register_completion_queue(f->server, f->cq); + f->server = grpc_server_create(ffd->server_args_compression, NULL); + grpc_server_register_completion_queue(f->server, f->cq, NULL); GPR_ASSERT(grpc_server_add_http2_port(f->server, ffd->localaddr)); grpc_server_start(f->server); } diff --git a/test/core/end2end/fixtures/chttp2_fullstack_uds_posix.c b/test/core/end2end/fixtures/chttp2_fullstack_uds_posix.c index 351e1c5459b..af6611b19f6 100644 --- a/test/core/end2end/fixtures/chttp2_fullstack_uds_posix.c +++ b/test/core/end2end/fixtures/chttp2_fullstack_uds_posix.c @@ -70,7 +70,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( unique++); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create(); + f.cq = grpc_completion_queue_create(NULL); return f; } @@ -78,7 +78,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( void chttp2_init_client_fullstack(grpc_end2end_test_fixture *f, grpc_channel_args *client_args) { fullstack_fixture_data *ffd = f->fixture_data; - f->client = grpc_channel_create(ffd->localaddr, client_args); + f->client = grpc_channel_create(ffd->localaddr, client_args, NULL); } void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f, @@ -87,8 +87,8 @@ void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f, if (f->server) { grpc_server_destroy(f->server); } - f->server = grpc_server_create(server_args); - grpc_server_register_completion_queue(f->server, f->cq); + f->server = grpc_server_create(server_args, NULL); + grpc_server_register_completion_queue(f->server, f->cq, NULL); GPR_ASSERT(grpc_server_add_http2_port(f->server, ffd->localaddr)); grpc_server_start(f->server); } diff --git a/test/core/end2end/fixtures/chttp2_fullstack_with_poll.c b/test/core/end2end/fixtures/chttp2_fullstack_with_poll.c index 69860d04d5e..43492149feb 100644 --- a/test/core/end2end/fixtures/chttp2_fullstack_with_poll.c +++ b/test/core/end2end/fixtures/chttp2_fullstack_with_poll.c @@ -64,7 +64,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create(); + f.cq = grpc_completion_queue_create(NULL); return f; } @@ -72,7 +72,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( void chttp2_init_client_fullstack(grpc_end2end_test_fixture *f, grpc_channel_args *client_args) { fullstack_fixture_data *ffd = f->fixture_data; - f->client = grpc_channel_create(ffd->localaddr, client_args); + f->client = grpc_channel_create(ffd->localaddr, client_args, NULL); } void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f, @@ -81,8 +81,8 @@ void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f, if (f->server) { grpc_server_destroy(f->server); } - f->server = grpc_server_create(server_args); - grpc_server_register_completion_queue(f->server, f->cq); + f->server = grpc_server_create(server_args, NULL); + grpc_server_register_completion_queue(f->server, f->cq, NULL); GPR_ASSERT(grpc_server_add_http2_port(f->server, ffd->localaddr)); grpc_server_start(f->server); } diff --git a/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack.c b/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack.c index 73a36116fb1..ce51ce7c286 100644 --- a/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack.c +++ b/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack.c @@ -63,7 +63,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create(); + f.cq = grpc_completion_queue_create(NULL); return f; } @@ -84,8 +84,8 @@ static void chttp2_init_server_secure_fullstack( if (f->server) { grpc_server_destroy(f->server); } - f->server = grpc_server_create(server_args); - grpc_server_register_completion_queue(f->server, f->cq); + f->server = grpc_server_create(server_args, NULL); + grpc_server_register_completion_queue(f->server, f->cq, NULL); GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr, server_creds)); grpc_server_credentials_release(server_creds); diff --git a/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack_with_poll.c b/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack_with_poll.c index b1ac3e535f1..5e1c3efd1d6 100644 --- a/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack_with_poll.c +++ b/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack_with_poll.c @@ -63,7 +63,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create(); + f.cq = grpc_completion_queue_create(NULL); return f; } @@ -84,8 +84,8 @@ static void chttp2_init_server_secure_fullstack( if (f->server) { grpc_server_destroy(f->server); } - f->server = grpc_server_create(server_args); - grpc_server_register_completion_queue(f->server, f->cq); + f->server = grpc_server_create(server_args, NULL); + grpc_server_register_completion_queue(f->server, f->cq, NULL); GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr, server_creds)); grpc_server_credentials_release(server_creds); diff --git a/test/core/end2end/fixtures/chttp2_simple_ssl_with_oauth2_fullstack.c b/test/core/end2end/fixtures/chttp2_simple_ssl_with_oauth2_fullstack.c index de418bf7ee0..5fb3cdb59d9 100644 --- a/test/core/end2end/fixtures/chttp2_simple_ssl_with_oauth2_fullstack.c +++ b/test/core/end2end/fixtures/chttp2_simple_ssl_with_oauth2_fullstack.c @@ -61,7 +61,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create(); + f.cq = grpc_completion_queue_create(NULL); return f; } @@ -82,8 +82,8 @@ static void chttp2_init_server_secure_fullstack( if (f->server) { grpc_server_destroy(f->server); } - f->server = grpc_server_create(server_args); - grpc_server_register_completion_queue(f->server, f->cq); + f->server = grpc_server_create(server_args, NULL); + grpc_server_register_completion_queue(f->server, f->cq, NULL); GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr, server_creds)); grpc_server_credentials_release(server_creds); diff --git a/test/core/end2end/fixtures/chttp2_socket_pair.c b/test/core/end2end/fixtures/chttp2_socket_pair.c index 37b61cf37fd..8236cb0a0a2 100644 --- a/test/core/end2end/fixtures/chttp2_socket_pair.c +++ b/test/core/end2end/fixtures/chttp2_socket_pair.c @@ -95,7 +95,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( grpc_end2end_test_fixture f; memset(&f, 0, sizeof(f)); f.fixture_data = sfd; - f.cq = grpc_completion_queue_create(); + f.cq = grpc_completion_queue_create(NULL); *sfd = grpc_iomgr_create_endpoint_pair("fixture", 65536); @@ -123,7 +123,7 @@ static void chttp2_init_server_socketpair(grpc_end2end_test_fixture *f, grpc_transport *transport; GPR_ASSERT(!f->server); f->server = grpc_server_create_from_filters(NULL, 0, server_args); - grpc_server_register_completion_queue(f->server, f->cq); + grpc_server_register_completion_queue(f->server, f->cq, NULL); grpc_server_start(f->server); transport = grpc_create_chttp2_transport(server_args, sfd->server, mdctx, 0); server_setup_transport(f, transport, mdctx); diff --git a/test/core/end2end/fixtures/chttp2_socket_pair_one_byte_at_a_time.c b/test/core/end2end/fixtures/chttp2_socket_pair_one_byte_at_a_time.c index 2ec26972889..653b0227aa5 100644 --- a/test/core/end2end/fixtures/chttp2_socket_pair_one_byte_at_a_time.c +++ b/test/core/end2end/fixtures/chttp2_socket_pair_one_byte_at_a_time.c @@ -95,7 +95,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( grpc_end2end_test_fixture f; memset(&f, 0, sizeof(f)); f.fixture_data = sfd; - f.cq = grpc_completion_queue_create(); + f.cq = grpc_completion_queue_create(NULL); *sfd = grpc_iomgr_create_endpoint_pair("fixture", 1); @@ -123,7 +123,7 @@ static void chttp2_init_server_socketpair(grpc_end2end_test_fixture *f, grpc_transport *transport; GPR_ASSERT(!f->server); f->server = grpc_server_create_from_filters(NULL, 0, server_args); - grpc_server_register_completion_queue(f->server, f->cq); + grpc_server_register_completion_queue(f->server, f->cq, NULL); grpc_server_start(f->server); transport = grpc_create_chttp2_transport(server_args, sfd->server, mdctx, 0); server_setup_transport(f, transport, mdctx); diff --git a/test/core/end2end/fixtures/chttp2_socket_pair_with_grpc_trace.c b/test/core/end2end/fixtures/chttp2_socket_pair_with_grpc_trace.c index 3aa364c5e0b..d5ac790689c 100644 --- a/test/core/end2end/fixtures/chttp2_socket_pair_with_grpc_trace.c +++ b/test/core/end2end/fixtures/chttp2_socket_pair_with_grpc_trace.c @@ -96,7 +96,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( grpc_end2end_test_fixture f; memset(&f, 0, sizeof(f)); f.fixture_data = sfd; - f.cq = grpc_completion_queue_create(); + f.cq = grpc_completion_queue_create(NULL); *sfd = grpc_iomgr_create_endpoint_pair("fixture", 65536); @@ -124,7 +124,7 @@ static void chttp2_init_server_socketpair(grpc_end2end_test_fixture *f, grpc_transport *transport; GPR_ASSERT(!f->server); f->server = grpc_server_create_from_filters(NULL, 0, server_args); - grpc_server_register_completion_queue(f->server, f->cq); + grpc_server_register_completion_queue(f->server, f->cq, NULL); grpc_server_start(f->server); transport = grpc_create_chttp2_transport(server_args, sfd->server, mdctx, 0); server_setup_transport(f, transport, mdctx); diff --git a/test/core/end2end/multiple_server_queues_test.c b/test/core/end2end/multiple_server_queues_test.c index 208d42e6e74..d85a2b49715 100644 --- a/test/core/end2end/multiple_server_queues_test.c +++ b/test/core/end2end/multiple_server_queues_test.c @@ -41,20 +41,20 @@ int main(int argc, char **argv) { grpc_test_init(argc, argv); grpc_init(); - cq1 = grpc_completion_queue_create(); - cq2 = grpc_completion_queue_create(); - server = grpc_server_create(NULL); - grpc_server_register_completion_queue(server, cq1); + cq1 = grpc_completion_queue_create(NULL); + cq2 = grpc_completion_queue_create(NULL); + server = grpc_server_create(NULL, NULL); + grpc_server_register_completion_queue(server, cq1, NULL); grpc_server_add_http2_port(server, "[::]:0"); - grpc_server_register_completion_queue(server, cq2); + grpc_server_register_completion_queue(server, cq2, NULL); grpc_server_start(server); grpc_server_shutdown_and_notify(server, cq2, NULL); grpc_completion_queue_next( - cq2, gpr_inf_future(GPR_CLOCK_REALTIME)); /* cue queue hang */ + cq2, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); /* cue queue hang */ grpc_completion_queue_shutdown(cq1); grpc_completion_queue_shutdown(cq2); - grpc_completion_queue_next(cq1, gpr_inf_future(GPR_CLOCK_REALTIME)); - grpc_completion_queue_next(cq2, gpr_inf_future(GPR_CLOCK_REALTIME)); + grpc_completion_queue_next(cq1, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); + grpc_completion_queue_next(cq2, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); grpc_server_destroy(server); grpc_completion_queue_destroy(cq1); grpc_completion_queue_destroy(cq2); diff --git a/test/core/end2end/no_server_test.c b/test/core/end2end/no_server_test.c index 79797f93751..aa1abf4d4d2 100644 --- a/test/core/end2end/no_server_test.c +++ b/test/core/end2end/no_server_test.c @@ -57,12 +57,13 @@ int main(int argc, char **argv) { grpc_metadata_array_init(&trailing_metadata_recv); - cq = grpc_completion_queue_create(); + cq = grpc_completion_queue_create(NULL); cqv = cq_verifier_create(cq); /* create a call, channel to a non existant server */ - chan = grpc_channel_create("nonexistant:54321", NULL); - call = grpc_channel_create_call(chan, cq, "/Foo", "nonexistant", deadline); + chan = grpc_channel_create("nonexistant:54321", NULL, NULL); + call = grpc_channel_create_call(chan, cq, "/Foo", "nonexistant", deadline, + NULL); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; @@ -77,7 +78,7 @@ int main(int argc, char **argv) { op->flags = 0; op++; GPR_ASSERT(GRPC_CALL_OK == - grpc_call_start_batch(call, ops, op - ops, tag(1))); + grpc_call_start_batch(call, ops, op - ops, tag(1), NULL)); /* verify that all tags get completed */ cq_expect_completion(cqv, tag(1), 1); cq_verify(cqv); @@ -85,8 +86,8 @@ int main(int argc, char **argv) { GPR_ASSERT(status == GRPC_STATUS_DEADLINE_EXCEEDED); grpc_completion_queue_shutdown(cq); - while (grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME)) - .type != GRPC_QUEUE_SHUTDOWN) + while (grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), + NULL).type != GRPC_QUEUE_SHUTDOWN) ; grpc_completion_queue_destroy(cq); grpc_call_destroy(call); diff --git a/test/core/end2end/tests/bad_hostname.c b/test/core/end2end/tests/bad_hostname.c index 2509ea06a01..a35923ce858 100644 --- a/test/core/end2end/tests/bad_hostname.c +++ b/test/core/end2end/tests/bad_hostname.c @@ -70,7 +70,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -78,7 +78,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -110,11 +111,12 @@ static void simple_request_body(grpc_end2end_test_fixture f) { grpc_metadata_array request_metadata_recv; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; c = grpc_channel_create_call(f.client, f.cq, "/foo", "slartibartfast.local", - deadline); + deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -141,7 +143,8 @@ static void simple_request_body(grpc_end2end_test_fixture f) { op->data.recv_status_on_client.status_details_capacity = &details_capacity; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1))); + error = grpc_call_start_batch(c, ops, op - ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(1), 1); cq_verify(cqv); diff --git a/test/core/end2end/tests/cancel_after_accept.c b/test/core/end2end/tests/cancel_after_accept.c index 1cc6b2d147b..db391b8d666 100644 --- a/test/core/end2end/tests/cancel_after_accept.c +++ b/test/core/end2end/tests/cancel_after_accept.c @@ -69,7 +69,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -77,7 +77,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -114,6 +115,7 @@ static void test_cancel_after_accept(grpc_end2end_test_config config, grpc_metadata_array request_metadata_recv; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; grpc_byte_buffer *request_payload_recv = NULL; @@ -127,7 +129,7 @@ static void test_cancel_after_accept(grpc_end2end_test_config config, int was_cancelled = 2; c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr", - deadline); + deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -159,11 +161,12 @@ static void test_cancel_after_accept(grpc_end2end_test_config config, op->data.recv_message = &response_payload_recv; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1))); + error = grpc_call_start_batch(c, ops, op - ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); - GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( - f.server, &s, &call_details, - &request_metadata_recv, f.cq, f.cq, tag(2))); + error = grpc_server_request_call(f.server, &s, &call_details, + &request_metadata_recv, f.cq, f.cq, tag(2)); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(2), 1); cq_verify(cqv); @@ -184,9 +187,10 @@ static void test_cancel_after_accept(grpc_end2end_test_config config, op->data.recv_close_on_server.cancelled = &was_cancelled; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(3))); + error = grpc_call_start_batch(s, ops, op - ops, tag(3), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); - GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c)); + GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c, NULL)); cq_expect_completion(cqv, tag(3), 1); cq_expect_completion(cqv, tag(1), 1); diff --git a/test/core/end2end/tests/cancel_after_accept_and_writes_closed.c b/test/core/end2end/tests/cancel_after_accept_and_writes_closed.c index 015d437543e..579fe7fc9a8 100644 --- a/test/core/end2end/tests/cancel_after_accept_and_writes_closed.c +++ b/test/core/end2end/tests/cancel_after_accept_and_writes_closed.c @@ -69,7 +69,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -77,7 +77,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -114,6 +115,7 @@ static void test_cancel_after_accept_and_writes_closed( grpc_metadata_array request_metadata_recv; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; grpc_byte_buffer *request_payload_recv = NULL; @@ -127,7 +129,7 @@ static void test_cancel_after_accept_and_writes_closed( int was_cancelled = 2; c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr", - deadline); + deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -162,11 +164,12 @@ static void test_cancel_after_accept_and_writes_closed( op->data.recv_message = &response_payload_recv; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1))); + error = grpc_call_start_batch(c, ops, op - ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); - GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( - f.server, &s, &call_details, - &request_metadata_recv, f.cq, f.cq, tag(2))); + error = grpc_server_request_call(f.server, &s, &call_details, + &request_metadata_recv, f.cq, f.cq, tag(2)); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(2), 1); cq_verify(cqv); @@ -187,9 +190,10 @@ static void test_cancel_after_accept_and_writes_closed( op->data.send_message = response_payload; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(3))); + error = grpc_call_start_batch(s, ops, op - ops, tag(3), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); - GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c)); + GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c, NULL)); cq_expect_completion(cqv, tag(3), 1); cq_expect_completion(cqv, tag(1), 1); diff --git a/test/core/end2end/tests/cancel_after_invoke.c b/test/core/end2end/tests/cancel_after_invoke.c index 414ec706ce0..afb51a03570 100644 --- a/test/core/end2end/tests/cancel_after_invoke.c +++ b/test/core/end2end/tests/cancel_after_invoke.c @@ -70,7 +70,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -78,7 +78,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -114,6 +115,7 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config, grpc_metadata_array request_metadata_recv; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; grpc_byte_buffer *response_payload_recv = NULL; @@ -122,7 +124,7 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config, grpc_raw_byte_buffer_create(&request_payload_slice, 1); c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr", - deadline); + deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -157,9 +159,10 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config, op->data.recv_message = &response_payload_recv; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, test_ops, tag(1))); + error = grpc_call_start_batch(c, ops, test_ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); - GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c)); + GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c, NULL)); cq_expect_completion(cqv, tag(1), 1); cq_verify(cqv); diff --git a/test/core/end2end/tests/cancel_before_invoke.c b/test/core/end2end/tests/cancel_before_invoke.c index 3cfe56eca28..55a6555bc16 100644 --- a/test/core/end2end/tests/cancel_before_invoke.c +++ b/test/core/end2end/tests/cancel_before_invoke.c @@ -68,7 +68,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -76,7 +76,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -112,6 +113,7 @@ static void test_cancel_before_invoke(grpc_end2end_test_config config, grpc_metadata_array request_metadata_recv; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; grpc_byte_buffer *response_payload_recv = NULL; @@ -120,10 +122,10 @@ static void test_cancel_before_invoke(grpc_end2end_test_config config, grpc_raw_byte_buffer_create(&request_payload_slice, 1); c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr", - deadline); + deadline, NULL); GPR_ASSERT(c); - GPR_ASSERT(GRPC_CALL_OK == grpc_call_cancel(c)); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_cancel(c, NULL)); grpc_metadata_array_init(&initial_metadata_recv); grpc_metadata_array_init(&trailing_metadata_recv); @@ -157,7 +159,8 @@ static void test_cancel_before_invoke(grpc_end2end_test_config config, op->data.recv_message = &response_payload_recv; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, test_ops, tag(1))); + error = grpc_call_start_batch(c, ops, test_ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(1), 1); cq_verify(cqv); diff --git a/test/core/end2end/tests/cancel_in_a_vacuum.c b/test/core/end2end/tests/cancel_in_a_vacuum.c index 8bffc3f4d3c..3324ddc8fc5 100644 --- a/test/core/end2end/tests/cancel_in_a_vacuum.c +++ b/test/core/end2end/tests/cancel_in_a_vacuum.c @@ -69,7 +69,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -77,7 +77,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -108,10 +109,10 @@ static void test_cancel_in_a_vacuum(grpc_end2end_test_config config, cq_verifier *v_client = cq_verifier_create(f.cq); c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr", - deadline); + deadline, NULL); GPR_ASSERT(c); - GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c)); + GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c, NULL)); grpc_call_destroy(c); diff --git a/test/core/end2end/tests/cancel_test_helpers.h b/test/core/end2end/tests/cancel_test_helpers.h index 8345c07904d..6ea822fa9ab 100644 --- a/test/core/end2end/tests/cancel_test_helpers.h +++ b/test/core/end2end/tests/cancel_test_helpers.h @@ -36,12 +36,13 @@ typedef struct { const char *name; - grpc_call_error (*initiate_cancel)(grpc_call *call); + grpc_call_error (*initiate_cancel)(grpc_call *call, void *reserved); grpc_status_code expect_status; const char *expect_details; } cancellation_mode; -static grpc_call_error wait_for_deadline(grpc_call *call) { +static grpc_call_error wait_for_deadline(grpc_call *call, void *reserved) { + (void) reserved; return GRPC_CALL_OK; } diff --git a/test/core/end2end/tests/census_simple_request.c b/test/core/end2end/tests/census_simple_request.c index b414755cd12..8ae13141476 100644 --- a/test/core/end2end/tests/census_simple_request.c +++ b/test/core/end2end/tests/census_simple_request.c @@ -67,7 +67,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -82,7 +83,7 @@ static void shutdown_client(grpc_end2end_test_fixture *f) { static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, n_seconds_time(5)); + ev = grpc_completion_queue_next(cq, n_seconds_time(5), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -107,12 +108,13 @@ static void test_body(grpc_end2end_test_fixture f) { grpc_metadata_array request_metadata_recv; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; int was_cancelled = 2; c = grpc_channel_create_call(f.client, f.cq, "/foo", - "foo.test.google.fr:1234", deadline); + "foo.test.google.fr:1234", deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -139,11 +141,13 @@ static void test_body(grpc_end2end_test_fixture f) { op->data.recv_status_on_client.status_details_capacity = &details_capacity; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1))); + error = grpc_call_start_batch(c, ops, op - ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); - GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( - f.server, &s, &call_details, - &request_metadata_recv, f.cq, f.cq, tag(101))); + error = grpc_server_request_call(f.server, &s, &call_details, + &request_metadata_recv, f.cq, f.cq, + tag(101)); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); @@ -162,7 +166,8 @@ static void test_body(grpc_end2end_test_fixture f) { op->data.recv_close_on_server.cancelled = &was_cancelled; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102))); + error = grpc_call_start_batch(s, ops, op - ops, tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(102), 1); cq_expect_completion(cqv, tag(1), 1); diff --git a/test/core/end2end/tests/disappearing_server.c b/test/core/end2end/tests/disappearing_server.c index 9acd18902a9..d1cee7b7493 100644 --- a/test/core/end2end/tests/disappearing_server.c +++ b/test/core/end2end/tests/disappearing_server.c @@ -56,7 +56,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -93,12 +93,13 @@ static void do_request_and_shutdown_server(grpc_end2end_test_fixture *f, grpc_metadata_array request_metadata_recv; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; int was_cancelled = 2; c = grpc_channel_create_call(f->client, f->cq, "/foo", - "foo.test.google.fr:1234", deadline); + "foo.test.google.fr:1234", deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -125,12 +126,13 @@ static void do_request_and_shutdown_server(grpc_end2end_test_fixture *f, op->data.recv_status_on_client.status_details_capacity = &details_capacity; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1))); + error = grpc_call_start_batch(c, ops, op - ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); - GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(f->server, &s, - &call_details, - &request_metadata_recv, - f->cq, f->cq, tag(101))); + error = grpc_server_request_call(f->server, &s, &call_details, + &request_metadata_recv, f->cq, f->cq, + tag(101)); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); @@ -153,7 +155,8 @@ static void do_request_and_shutdown_server(grpc_end2end_test_fixture *f, op->data.recv_close_on_server.cancelled = &was_cancelled; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102))); + error = grpc_call_start_batch(s, ops, op - ops, tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(102), 1); cq_expect_completion(cqv, tag(1), 1); diff --git a/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c b/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c index adc59b4e942..ff8dd8c90ee 100644 --- a/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c +++ b/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c @@ -68,7 +68,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -101,12 +101,13 @@ static void test_early_server_shutdown_finishes_inflight_calls( grpc_metadata_array request_metadata_recv; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; int was_cancelled = 2; c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr", - deadline); + deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -134,11 +135,13 @@ static void test_early_server_shutdown_finishes_inflight_calls( op->data.recv_status_on_client.status_details_capacity = &details_capacity; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1))); + error = grpc_call_start_batch(c, ops, op - ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); - GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( - f.server, &s, &call_details, - &request_metadata_recv, f.cq, f.cq, tag(101))); + error = grpc_server_request_call(f.server, &s, &call_details, + &request_metadata_recv, f.cq, f.cq, + tag(101)); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); @@ -147,7 +150,8 @@ static void test_early_server_shutdown_finishes_inflight_calls( op->data.recv_close_on_server.cancelled = &was_cancelled; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102))); + error = grpc_call_start_batch(s, ops, op - ops, tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); /* shutdown and destroy the server */ grpc_server_shutdown_and_notify(f.server, f.cq, tag(1000)); diff --git a/test/core/end2end/tests/early_server_shutdown_finishes_tags.c b/test/core/end2end/tests/early_server_shutdown_finishes_tags.c index fc03cb01a81..9b678a17541 100644 --- a/test/core/end2end/tests/early_server_shutdown_finishes_tags.c +++ b/test/core/end2end/tests/early_server_shutdown_finishes_tags.c @@ -68,7 +68,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } diff --git a/test/core/end2end/tests/empty_batch.c b/test/core/end2end/tests/empty_batch.c index db8458d3d91..7e244c79c1d 100644 --- a/test/core/end2end/tests/empty_batch.c +++ b/test/core/end2end/tests/empty_batch.c @@ -70,7 +70,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -78,7 +78,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -103,13 +104,15 @@ static void empty_batch_body(grpc_end2end_test_fixture f) { grpc_call *c; gpr_timespec deadline = five_seconds_time(); cq_verifier *cqv = cq_verifier_create(f.cq); + grpc_call_error error; grpc_op *op = NULL; c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr", - deadline); + deadline, NULL); GPR_ASSERT(c); - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, op, 0, tag(1))); + error = grpc_call_start_batch(c, op, 0, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(1), 1); cq_verify(cqv); diff --git a/test/core/end2end/tests/graceful_server_shutdown.c b/test/core/end2end/tests/graceful_server_shutdown.c index 8c1889add9f..cb1b730ca6a 100644 --- a/test/core/end2end/tests/graceful_server_shutdown.c +++ b/test/core/end2end/tests/graceful_server_shutdown.c @@ -68,7 +68,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -108,12 +108,13 @@ static void test_early_server_shutdown_finishes_inflight_calls( grpc_metadata_array request_metadata_recv; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; int was_cancelled = 2; c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr", - deadline); + deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -141,11 +142,13 @@ static void test_early_server_shutdown_finishes_inflight_calls( op->data.recv_status_on_client.status_details_capacity = &details_capacity; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1))); + error = grpc_call_start_batch(c, ops, op - ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); - GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( - f.server, &s, &call_details, - &request_metadata_recv, f.cq, f.cq, tag(101))); + error = grpc_server_request_call(f.server, &s, &call_details, + &request_metadata_recv, f.cq, f.cq, + tag(101)); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); @@ -168,7 +171,8 @@ static void test_early_server_shutdown_finishes_inflight_calls( op->data.recv_close_on_server.cancelled = &was_cancelled; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102))); + error = grpc_call_start_batch(s, ops, op - ops, tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(102), 1); cq_expect_completion(cqv, tag(0xdead), 1); diff --git a/test/core/end2end/tests/invoke_large_request.c b/test/core/end2end/tests/invoke_large_request.c index 744a9ada57d..2e517fa598a 100644 --- a/test/core/end2end/tests/invoke_large_request.c +++ b/test/core/end2end/tests/invoke_large_request.c @@ -66,7 +66,7 @@ static gpr_timespec n_seconds_time(int n) { static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, n_seconds_time(5)); + ev = grpc_completion_queue_next(cq, n_seconds_time(5), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -74,7 +74,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -124,12 +125,13 @@ static void test_invoke_large_request(grpc_end2end_test_config config) { grpc_byte_buffer *response_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; int was_cancelled = 2; c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr", - deadline); + deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -164,11 +166,13 @@ static void test_invoke_large_request(grpc_end2end_test_config config) { op->data.recv_status_on_client.status_details_capacity = &details_capacity; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1))); + error = grpc_call_start_batch(c, ops, op - ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); - GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( - f.server, &s, &call_details, - &request_metadata_recv, f.cq, f.cq, tag(101))); + error = grpc_server_request_call(f.server, &s, &call_details, + &request_metadata_recv, f.cq, f.cq, + tag(101)); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); @@ -181,7 +185,8 @@ static void test_invoke_large_request(grpc_end2end_test_config config) { op->data.recv_message = &request_payload_recv; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102))); + error = grpc_call_start_batch(s, ops, op - ops, tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(102), 1); cq_verify(cqv); @@ -201,7 +206,8 @@ static void test_invoke_large_request(grpc_end2end_test_config config) { op->data.send_status_from_server.status_details = "xyz"; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(103))); + error = grpc_call_start_batch(s, ops, op - ops, tag(103), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(103), 1); cq_expect_completion(cqv, tag(1), 1); diff --git a/test/core/end2end/tests/max_concurrent_streams.c b/test/core/end2end/tests/max_concurrent_streams.c index 1204c070af4..88ab7b19a29 100644 --- a/test/core/end2end/tests/max_concurrent_streams.c +++ b/test/core/end2end/tests/max_concurrent_streams.c @@ -68,7 +68,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -76,7 +76,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -109,12 +110,13 @@ static void simple_request_body(grpc_end2end_test_fixture f) { grpc_metadata_array request_metadata_recv; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; int was_cancelled = 2; c = grpc_channel_create_call(f.client, f.cq, "/foo", - "foo.test.google.fr:1234", deadline); + "foo.test.google.fr:1234", deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -141,11 +143,13 @@ static void simple_request_body(grpc_end2end_test_fixture f) { op->data.recv_status_on_client.status_details_capacity = &details_capacity; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1))); + error = grpc_call_start_batch(c, ops, op - ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); - GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( - f.server, &s, &call_details, - &request_metadata_recv, f.cq, f.cq, tag(101))); + error = grpc_server_request_call(f.server, &s, &call_details, + &request_metadata_recv, f.cq, f.cq, + tag(101)); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); @@ -164,7 +168,8 @@ static void simple_request_body(grpc_end2end_test_fixture f) { op->data.recv_close_on_server.cancelled = &was_cancelled; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102))); + error = grpc_call_start_batch(s, ops, op - ops, tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(102), 1); cq_expect_completion(cqv, tag(1), 1); @@ -207,6 +212,7 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { grpc_metadata_array initial_metadata_recv2; grpc_metadata_array trailing_metadata_recv2; grpc_status_code status1; + grpc_call_error error; char *details1 = NULL; size_t details_capacity1 = 0; grpc_status_code status2; @@ -245,10 +251,10 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { the first completes */ deadline = n_seconds_time(1000); c1 = grpc_channel_create_call(f.client, f.cq, "/alpha", - "foo.test.google.fr:1234", deadline); + "foo.test.google.fr:1234", deadline, NULL); GPR_ASSERT(c1); c2 = grpc_channel_create_call(f.client, f.cq, "/beta", - "foo.test.google.fr:1234", deadline); + "foo.test.google.fr:1234", deadline, NULL); GPR_ASSERT(c2); GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( @@ -263,8 +269,8 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == - grpc_call_start_batch(c1, ops, op - ops, tag(301))); + error = grpc_call_start_batch(c1, ops, op - ops, tag(301), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); op = ops; op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; @@ -278,8 +284,8 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { op->data.recv_initial_metadata = &initial_metadata_recv1; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == - grpc_call_start_batch(c1, ops, op - ops, tag(302))); + error = grpc_call_start_batch(c1, ops, op - ops, tag(302), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; @@ -289,8 +295,8 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == - grpc_call_start_batch(c2, ops, op - ops, tag(401))); + error = grpc_call_start_batch(c2, ops, op - ops, tag(401), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); op = ops; op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; @@ -304,14 +310,15 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { op->data.recv_initial_metadata = &initial_metadata_recv1; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == - grpc_call_start_batch(c2, ops, op - ops, tag(402))); + error = grpc_call_start_batch(c2, ops, op - ops, tag(402), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); got_client_start = 0; got_server_start = 0; live_call = -1; while (!got_client_start || !got_server_start) { - ev = grpc_completion_queue_next(f.cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3)); + ev = grpc_completion_queue_next(f.cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), + NULL); GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); GPR_ASSERT(ev.success); if (ev.tag == tag(101)) { @@ -345,8 +352,8 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { op->data.send_status_from_server.status_details = "xyz"; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == - grpc_call_start_batch(s1, ops, op - ops, tag(102))); + error = grpc_call_start_batch(s1, ops, op - ops, tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(102), 1); cq_expect_completion(cqv, tag(live_call + 2), 1); @@ -376,8 +383,8 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { op->data.send_status_from_server.status_details = "xyz"; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == - grpc_call_start_batch(s2, ops, op - ops, tag(202))); + error = grpc_call_start_batch(s2, ops, op - ops, tag(202), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(live_call + 2), 1); cq_expect_completion(cqv, tag(202), 1); diff --git a/test/core/end2end/tests/max_message_length.c b/test/core/end2end/tests/max_message_length.c index ea59a9385fe..c022eb9264b 100644 --- a/test/core/end2end/tests/max_message_length.c +++ b/test/core/end2end/tests/max_message_length.c @@ -68,7 +68,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -76,7 +76,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -114,6 +115,7 @@ static void test_max_message_length(grpc_end2end_test_config config) { grpc_metadata_array request_metadata_recv; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; int was_cancelled = 2; @@ -130,7 +132,7 @@ static void test_max_message_length(grpc_end2end_test_config config) { c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr:1234", - gpr_inf_future(GPR_CLOCK_REALTIME)); + gpr_inf_future(GPR_CLOCK_REALTIME), NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -161,11 +163,13 @@ static void test_max_message_length(grpc_end2end_test_config config) { op->data.recv_status_on_client.status_details_capacity = &details_capacity; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1))); + error = grpc_call_start_batch(c, ops, op - ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); - GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( - f.server, &s, &call_details, - &request_metadata_recv, f.cq, f.cq, tag(101))); + error = grpc_server_request_call(f.server, &s, &call_details, + &request_metadata_recv, f.cq, f.cq, + tag(101)); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); @@ -174,7 +178,8 @@ static void test_max_message_length(grpc_end2end_test_config config) { op->data.recv_close_on_server.cancelled = &was_cancelled; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102))); + error = grpc_call_start_batch(s, ops, op - ops, tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(102), 1); cq_expect_completion(cqv, tag(1), 1); diff --git a/test/core/end2end/tests/no_op.c b/test/core/end2end/tests/no_op.c index 8ead6647580..565d4ea2806 100644 --- a/test/core/end2end/tests/no_op.c +++ b/test/core/end2end/tests/no_op.c @@ -68,7 +68,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -76,7 +76,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/ping_pong_streaming.c b/test/core/end2end/tests/ping_pong_streaming.c index 8a3ec96212f..a67fac133da 100644 --- a/test/core/end2end/tests/ping_pong_streaming.c +++ b/test/core/end2end/tests/ping_pong_streaming.c @@ -68,7 +68,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -76,7 +76,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -113,6 +114,7 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, grpc_metadata_array request_metadata_recv; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; int was_cancelled = 2; @@ -125,7 +127,7 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, gpr_slice response_payload_slice = gpr_slice_from_copied_string("hello you"); c = grpc_channel_create_call(f.client, f.cq, "/foo", - "foo.test.google.fr:1234", deadline); + "foo.test.google.fr:1234", deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -149,11 +151,13 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, op->data.recv_status_on_client.status_details_capacity = &details_capacity; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1))); + error = grpc_call_start_batch(c, ops, op - ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); - GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( - f.server, &s, &call_details, - &request_metadata_recv, f.cq, f.cq, tag(100))); + error = grpc_server_request_call(f.server, &s, &call_details, + &request_metadata_recv, f.cq, f.cq, + tag(100)); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(100), 1); cq_verify(cqv); @@ -166,7 +170,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, op->data.recv_close_on_server.cancelled = &was_cancelled; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(101))); + error = grpc_call_start_batch(s, ops, op - ops, tag(101), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); for (i = 0; i < messages; i++) { request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); @@ -181,15 +186,16 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, op->data.recv_message = &response_payload_recv; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(2))); + error = grpc_call_start_batch(c, ops, op - ops, tag(2), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); op = ops; op->op = GRPC_OP_RECV_MESSAGE; op->data.recv_message = &request_payload_recv; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == - grpc_call_start_batch(s, ops, op - ops, tag(102))); + error = grpc_call_start_batch(s, ops, op - ops, tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(102), 1); cq_verify(cqv); @@ -198,8 +204,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, op->data.send_message = response_payload; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == - grpc_call_start_batch(s, ops, op - ops, tag(103))); + error = grpc_call_start_batch(s, ops, op - ops, tag(103), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(103), 1); cq_expect_completion(cqv, tag(2), 1); cq_verify(cqv); @@ -217,7 +223,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(3))); + error = grpc_call_start_batch(c, ops, op - ops, tag(3), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); op = ops; op->op = GRPC_OP_SEND_STATUS_FROM_SERVER; @@ -226,7 +233,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, op->data.send_status_from_server.status_details = "xyz"; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(104))); + error = grpc_call_start_batch(s, ops, op - ops, tag(104), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(1), 1); cq_expect_completion(cqv, tag(3), 1); diff --git a/test/core/end2end/tests/registered_call.c b/test/core/end2end/tests/registered_call.c index f44fd3a224d..0ffae8cdbcf 100644 --- a/test/core/end2end/tests/registered_call.c +++ b/test/core/end2end/tests/registered_call.c @@ -70,7 +70,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -78,7 +78,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -111,11 +112,12 @@ static void simple_request_body(grpc_end2end_test_fixture f, void *rc) { grpc_metadata_array request_metadata_recv; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; int was_cancelled = 2; - c = grpc_channel_create_registered_call(f.client, f.cq, rc, deadline); + c = grpc_channel_create_registered_call(f.client, f.cq, rc, deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -142,11 +144,13 @@ static void simple_request_body(grpc_end2end_test_fixture f, void *rc) { op->data.recv_status_on_client.status_details_capacity = &details_capacity; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1))); + error = grpc_call_start_batch(c, ops, op - ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); - GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( - f.server, &s, &call_details, - &request_metadata_recv, f.cq, f.cq, tag(101))); + error = grpc_server_request_call(f.server, &s, &call_details, + &request_metadata_recv, f.cq, f.cq, + tag(101)); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); @@ -165,7 +169,8 @@ static void simple_request_body(grpc_end2end_test_fixture f, void *rc) { op->data.recv_close_on_server.cancelled = &was_cancelled; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102))); + error = grpc_call_start_batch(s, ops, op - ops, tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(102), 1); cq_expect_completion(cqv, tag(1), 1); @@ -193,7 +198,8 @@ static void test_invoke_simple_request(grpc_end2end_test_config config) { grpc_end2end_test_fixture f = begin_test(config, "test_invoke_simple_request", NULL, NULL); void *rc = - grpc_channel_register_call(f.client, "/foo", "foo.test.google.fr:1234"); + grpc_channel_register_call(f.client, "/foo", "foo.test.google.fr:1234", + NULL); simple_request_body(f, rc); end_test(&f); @@ -205,7 +211,8 @@ static void test_invoke_10_simple_requests(grpc_end2end_test_config config) { grpc_end2end_test_fixture f = begin_test(config, "test_invoke_10_simple_requests", NULL, NULL); void *rc = - grpc_channel_register_call(f.client, "/foo", "foo.test.google.fr:1234"); + grpc_channel_register_call(f.client, "/foo", "foo.test.google.fr:1234", + NULL); for (i = 0; i < 10; i++) { simple_request_body(f, rc); diff --git a/test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c b/test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c index 8b8a11babe1..48fb0969762 100644 --- a/test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c +++ b/test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c @@ -68,7 +68,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -76,7 +76,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -113,20 +114,24 @@ static void test_request_response_with_metadata_and_payload( {"key1-bin", "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc", 13, - {{NULL, NULL, NULL}}}, + 0, + {{NULL, NULL, NULL, NULL}}}, {"key2-bin", "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d", 14, - {{NULL, NULL, NULL}}}}; + 0, + {{NULL, NULL, NULL, NULL}}}}; grpc_metadata meta_s[2] = { {"key3-bin", "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee", 15, - {{NULL, NULL, NULL}}}, + 0, + {{NULL, NULL, NULL, NULL}}}, {"key4-bin", "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff", 16, - {{NULL, NULL, NULL}}}}; + 0, + {{NULL, NULL, NULL, NULL}}}}; grpc_end2end_test_fixture f = begin_test( config, "test_request_response_with_metadata_and_payload", NULL, NULL); cq_verifier *cqv = cq_verifier_create(f.cq); @@ -139,12 +144,13 @@ static void test_request_response_with_metadata_and_payload( grpc_byte_buffer *response_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; int was_cancelled = 2; c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr", - deadline); + deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -180,11 +186,13 @@ static void test_request_response_with_metadata_and_payload( op->data.recv_status_on_client.status_details_capacity = &details_capacity; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1))); + error = grpc_call_start_batch(c, ops, op - ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); - GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( - f.server, &s, &call_details, - &request_metadata_recv, f.cq, f.cq, tag(101))); + error = grpc_server_request_call(f.server, &s, &call_details, + &request_metadata_recv, f.cq, f.cq, + tag(101)); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); @@ -198,7 +206,8 @@ static void test_request_response_with_metadata_and_payload( op->data.recv_message = &request_payload_recv; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102))); + error = grpc_call_start_batch(s, ops, op - ops, tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(102), 1); cq_verify(cqv); @@ -218,7 +227,8 @@ static void test_request_response_with_metadata_and_payload( op->data.send_status_from_server.status_details = "xyz"; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(103))); + error = grpc_call_start_batch(s, ops, op - ops, tag(103), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(103), 1); cq_expect_completion(cqv, tag(1), 1); diff --git a/test/core/end2end/tests/request_response_with_metadata_and_payload.c b/test/core/end2end/tests/request_response_with_metadata_and_payload.c index ef6dfe9561f..c28173cc7ed 100644 --- a/test/core/end2end/tests/request_response_with_metadata_and_payload.c +++ b/test/core/end2end/tests/request_response_with_metadata_and_payload.c @@ -68,7 +68,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -76,7 +76,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -109,10 +110,10 @@ static void test_request_response_with_metadata_and_payload( grpc_byte_buffer *response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1); gpr_timespec deadline = five_seconds_time(); - grpc_metadata meta_c[2] = {{"key1", "val1", 4, {{NULL, NULL, NULL}}}, - {"key2", "val2", 4, {{NULL, NULL, NULL}}}}; - grpc_metadata meta_s[2] = {{"key3", "val3", 4, {{NULL, NULL, NULL}}}, - {"key4", "val4", 4, {{NULL, NULL, NULL}}}}; + grpc_metadata meta_c[2] = {{"key1", "val1", 4, 0, {{NULL, NULL, NULL, NULL}}}, + {"key2", "val2", 4, 0, {{NULL, NULL, NULL, NULL}}}}; + grpc_metadata meta_s[2] = {{"key3", "val3", 4, 0, {{NULL, NULL, NULL, NULL}}}, + {"key4", "val4", 4, 0, {{NULL, NULL, NULL, NULL}}}}; grpc_end2end_test_fixture f = begin_test( config, "test_request_response_with_metadata_and_payload", NULL, NULL); cq_verifier *cqv = cq_verifier_create(f.cq); @@ -125,12 +126,13 @@ static void test_request_response_with_metadata_and_payload( grpc_byte_buffer *response_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; int was_cancelled = 2; c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr", - deadline); + deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -166,11 +168,13 @@ static void test_request_response_with_metadata_and_payload( op->data.recv_status_on_client.status_details_capacity = &details_capacity; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1))); + error = grpc_call_start_batch(c, ops, op - ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); - GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( - f.server, &s, &call_details, - &request_metadata_recv, f.cq, f.cq, tag(101))); + error = grpc_server_request_call(f.server, &s, &call_details, + &request_metadata_recv, f.cq, f.cq, + tag(101)); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); @@ -184,7 +188,8 @@ static void test_request_response_with_metadata_and_payload( op->data.recv_message = &request_payload_recv; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102))); + error = grpc_call_start_batch(s, ops, op - ops, tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(102), 1); cq_verify(cqv); @@ -204,7 +209,8 @@ static void test_request_response_with_metadata_and_payload( op->data.send_status_from_server.status_details = "xyz"; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(103))); + error = grpc_call_start_batch(s, ops, op - ops, tag(103), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(103), 1); cq_expect_completion(cqv, tag(1), 1); diff --git a/test/core/end2end/tests/request_response_with_payload.c b/test/core/end2end/tests/request_response_with_payload.c index 38d3432f94e..d21d5fac6be 100644 --- a/test/core/end2end/tests/request_response_with_payload.c +++ b/test/core/end2end/tests/request_response_with_payload.c @@ -68,7 +68,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -76,7 +76,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -117,12 +118,13 @@ static void request_response_with_payload(grpc_end2end_test_fixture f) { grpc_byte_buffer *response_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; int was_cancelled = 2; c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr", - deadline); + deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -157,11 +159,13 @@ static void request_response_with_payload(grpc_end2end_test_fixture f) { op->data.recv_status_on_client.status_details_capacity = &details_capacity; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1))); + error = grpc_call_start_batch(c, ops, op - ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); - GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( - f.server, &s, &call_details, - &request_metadata_recv, f.cq, f.cq, tag(101))); + error = grpc_server_request_call(f.server, &s, &call_details, + &request_metadata_recv, f.cq, f.cq, + tag(101)); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); @@ -174,7 +178,8 @@ static void request_response_with_payload(grpc_end2end_test_fixture f) { op->data.recv_message = &request_payload_recv; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102))); + error = grpc_call_start_batch(s, ops, op - ops, tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(102), 1); cq_verify(cqv); @@ -194,7 +199,8 @@ static void request_response_with_payload(grpc_end2end_test_fixture f) { op->data.send_status_from_server.status_details = "xyz"; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(103))); + error = grpc_call_start_batch(s, ops, op - ops, tag(103), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(103), 1); cq_expect_completion(cqv, tag(1), 1); 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 b5c743b4056..d678e7b2335 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 @@ -78,7 +78,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -86,7 +86,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -131,7 +132,7 @@ static void test_call_creds_failure(grpc_end2end_test_config config) { begin_test(config, "test_call_creds_failure", NULL, NULL); gpr_timespec deadline = five_seconds_time(); c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr", - deadline); + deadline, NULL); GPR_ASSERT(c); /* Try with credentials unfit to be set on a call (channel creds). */ @@ -169,6 +170,7 @@ static void request_response_with_payload_and_call_creds( grpc_byte_buffer *response_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; int was_cancelled = 2; @@ -176,7 +178,7 @@ static void request_response_with_payload_and_call_creds( grpc_auth_context *s_auth_context = NULL; c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr", - deadline); + deadline, NULL); GPR_ASSERT(c); creds = grpc_iam_credentials_create(iam_token, iam_selector); GPR_ASSERT(creds != NULL); @@ -229,11 +231,13 @@ static void request_response_with_payload_and_call_creds( op->data.recv_status_on_client.status_details_capacity = &details_capacity; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1))); + error = grpc_call_start_batch(c, ops, op - ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); - GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( - f.server, &s, &call_details, - &request_metadata_recv, f.cq, f.cq, tag(101))); + error = grpc_server_request_call(f.server, &s, &call_details, + &request_metadata_recv, f.cq, f.cq, + tag(101)); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); s_auth_context = grpc_call_auth_context(s); @@ -253,7 +257,8 @@ static void request_response_with_payload_and_call_creds( op->data.recv_message = &request_payload_recv; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102))); + error = grpc_call_start_batch(s, ops, op - ops, tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(102), 1); cq_verify(cqv); @@ -273,7 +278,8 @@ static void request_response_with_payload_and_call_creds( op->data.send_status_from_server.status_details = "xyz"; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(103))); + error = grpc_call_start_batch(s, ops, op - ops, tag(103), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(103), 1); cq_expect_completion(cqv, tag(1), 1); diff --git a/test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c b/test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c index a5c0851d056..a50ad6fdf30 100644 --- a/test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c +++ b/test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c @@ -68,7 +68,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -76,7 +76,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -109,12 +110,12 @@ static void test_request_response_with_metadata_and_payload( grpc_byte_buffer *response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1); gpr_timespec deadline = five_seconds_time(); - grpc_metadata meta_c[2] = {{"key1", "val1", 4, {{NULL, NULL, NULL}}}, - {"key2", "val2", 4, {{NULL, NULL, NULL}}}}; - grpc_metadata meta_s[2] = {{"key3", "val3", 4, {{NULL, NULL, NULL}}}, - {"key4", "val4", 4, {{NULL, NULL, NULL}}}}; - grpc_metadata meta_t[2] = {{"key5", "val5", 4, {{NULL, NULL, NULL}}}, - {"key6", "val6", 4, {{NULL, NULL, NULL}}}}; + grpc_metadata meta_c[2] = {{"key1", "val1", 4, 0, {{NULL, NULL, NULL, NULL}}}, + {"key2", "val2", 4, 0, {{NULL, NULL, NULL, NULL}}}}; + grpc_metadata meta_s[2] = {{"key3", "val3", 4, 0, {{NULL, NULL, NULL, NULL}}}, + {"key4", "val4", 4, 0, {{NULL, NULL, NULL, NULL}}}}; + grpc_metadata meta_t[2] = {{"key5", "val5", 4, 0, {{NULL, NULL, NULL, NULL}}}, + {"key6", "val6", 4, 0, {{NULL, NULL, NULL, NULL}}}}; grpc_end2end_test_fixture f = begin_test( config, "test_request_response_with_metadata_and_payload", NULL, NULL); cq_verifier *cqv = cq_verifier_create(f.cq); @@ -127,12 +128,13 @@ static void test_request_response_with_metadata_and_payload( grpc_byte_buffer *response_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; int was_cancelled = 2; c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr", - deadline); + deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -168,11 +170,13 @@ static void test_request_response_with_metadata_and_payload( op->data.recv_status_on_client.status_details_capacity = &details_capacity; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1))); + error = grpc_call_start_batch(c, ops, op - ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); - GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( - f.server, &s, &call_details, - &request_metadata_recv, f.cq, f.cq, tag(101))); + error = grpc_server_request_call(f.server, &s, &call_details, + &request_metadata_recv, f.cq, f.cq, + tag(101)); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); @@ -186,7 +190,8 @@ static void test_request_response_with_metadata_and_payload( op->data.recv_message = &request_payload_recv; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102))); + error = grpc_call_start_batch(s, ops, op - ops, tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(102), 1); cq_verify(cqv); @@ -207,7 +212,8 @@ static void test_request_response_with_metadata_and_payload( op->data.send_status_from_server.status_details = "xyz"; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(103))); + error = grpc_call_start_batch(s, ops, op - ops, tag(103), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(103), 1); cq_expect_completion(cqv, tag(1), 1); diff --git a/test/core/end2end/tests/request_with_compressed_payload.c b/test/core/end2end/tests/request_with_compressed_payload.c index 2599f796d22..69fb70c7a89 100644 --- a/test/core/end2end/tests/request_with_compressed_payload.c +++ b/test/core/end2end/tests/request_with_compressed_payload.c @@ -72,7 +72,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -80,7 +80,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -123,6 +124,7 @@ static void request_with_payload_template( grpc_byte_buffer *request_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; int was_cancelled = 2; @@ -142,7 +144,7 @@ static void request_with_payload_template( cqv = cq_verifier_create(f.cq); c = grpc_channel_create_call(f.client, f.cq, "/foo", - "foo.test.google.fr", deadline); + "foo.test.google.fr", deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -178,12 +180,13 @@ static void request_with_payload_template( op->data.recv_status_on_client.status_details_capacity = &details_capacity; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1))); + error = grpc_call_start_batch(c, ops, op - ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); - GPR_ASSERT(GRPC_CALL_OK == - grpc_server_request_call(f.server, &s, &call_details, - &request_metadata_recv, f.cq, - f.cq, tag(101))); + error = grpc_server_request_call(f.server, &s, &call_details, + &request_metadata_recv, f.cq, + f.cq, tag(101)); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); @@ -196,7 +199,8 @@ static void request_with_payload_template( op->data.recv_message = &request_payload_recv; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102))); + error = grpc_call_start_batch(s, ops, op - ops, tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(102), 1); cq_verify(cqv); @@ -212,7 +216,8 @@ static void request_with_payload_template( op->data.send_status_from_server.status_details = "xyz"; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(103))); + error = grpc_call_start_batch(s, ops, op - ops, tag(103), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(103), 1); cq_expect_completion(cqv, tag(1), 1); diff --git a/test/core/end2end/tests/request_with_flags.c b/test/core/end2end/tests/request_with_flags.c index 0bfedca0abf..2863de7a85f 100644 --- a/test/core/end2end/tests/request_with_flags.c +++ b/test/core/end2end/tests/request_with_flags.c @@ -69,7 +69,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -77,7 +77,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -117,12 +118,13 @@ static void test_invoke_request_with_flags( grpc_byte_buffer *request_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; grpc_call_error expectation; c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr", - deadline); + deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -154,7 +156,8 @@ static void test_invoke_request_with_flags( op->flags = flags_for_op[op->op]; op++; expectation = call_start_batch_expected_result; - GPR_ASSERT(expectation == grpc_call_start_batch(c, ops, op - ops, tag(1))); + error = grpc_call_start_batch(c, ops, op - ops, tag(1), NULL); + GPR_ASSERT(expectation == error); if (expectation == GRPC_CALL_OK) { cq_expect_completion(cqv, tag(1), 1); diff --git a/test/core/end2end/tests/request_with_large_metadata.c b/test/core/end2end/tests/request_with_large_metadata.c index ad34c697744..2690784ae6e 100644 --- a/test/core/end2end/tests/request_with_large_metadata.c +++ b/test/core/end2end/tests/request_with_large_metadata.c @@ -68,7 +68,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -76,7 +76,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -117,13 +118,14 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) { grpc_byte_buffer *request_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; int was_cancelled = 2; const int large_size = 64 * 1024; c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr", - deadline); + deadline, NULL); GPR_ASSERT(c); meta.key = "key"; @@ -161,11 +163,13 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) { op->data.recv_status_on_client.status_details_capacity = &details_capacity; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1))); + error = grpc_call_start_batch(c, ops, op - ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); - GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( - f.server, &s, &call_details, - &request_metadata_recv, f.cq, f.cq, tag(101))); + error = grpc_server_request_call(f.server, &s, &call_details, + &request_metadata_recv, f.cq, f.cq, + tag(101)); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); @@ -178,7 +182,8 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) { op->data.recv_message = &request_payload_recv; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102))); + error = grpc_call_start_batch(s, ops, op - ops, tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(102), 1); cq_verify(cqv); @@ -194,7 +199,8 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) { op->data.send_status_from_server.status_details = "xyz"; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(103))); + error = grpc_call_start_batch(s, ops, op - ops, tag(103), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(103), 1); cq_expect_completion(cqv, tag(1), 1); diff --git a/test/core/end2end/tests/request_with_payload.c b/test/core/end2end/tests/request_with_payload.c index 8db6457830c..6fe96e100a5 100644 --- a/test/core/end2end/tests/request_with_payload.c +++ b/test/core/end2end/tests/request_with_payload.c @@ -68,7 +68,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -76,7 +76,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -116,12 +117,13 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { grpc_byte_buffer *request_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; int was_cancelled = 2; c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr", - deadline); + deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -152,7 +154,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op->data.recv_status_on_client.status_details_capacity = &details_capacity; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1))); + error = grpc_call_start_batch(c, ops, op - ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( f.server, &s, &call_details, @@ -169,7 +172,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op->data.recv_message = &request_payload_recv; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102))); + error = grpc_call_start_batch(s, ops, op - ops, tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(102), 1); cq_verify(cqv); @@ -185,7 +189,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { op->data.send_status_from_server.status_details = "xyz"; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(103))); + error = grpc_call_start_batch(s, ops, op - ops, tag(103), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(103), 1); cq_expect_completion(cqv, tag(1), 1); diff --git a/test/core/end2end/tests/server_finishes_request.c b/test/core/end2end/tests/server_finishes_request.c index 062a59aca29..31119258f1d 100644 --- a/test/core/end2end/tests/server_finishes_request.c +++ b/test/core/end2end/tests/server_finishes_request.c @@ -70,7 +70,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -78,7 +78,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -111,12 +112,13 @@ static void simple_request_body(grpc_end2end_test_fixture f) { grpc_metadata_array request_metadata_recv; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; int was_cancelled = 2; c = grpc_channel_create_call(f.client, f.cq, "/foo", - "foo.test.google.fr:1234", deadline); + "foo.test.google.fr:1234", deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -140,11 +142,13 @@ static void simple_request_body(grpc_end2end_test_fixture f) { op->data.recv_status_on_client.status_details_capacity = &details_capacity; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1))); + error = grpc_call_start_batch(c, ops, op - ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); - GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( - f.server, &s, &call_details, - &request_metadata_recv, f.cq, f.cq, tag(101))); + error = grpc_server_request_call(f.server, &s, &call_details, + &request_metadata_recv, f.cq, f.cq, + tag(101)); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); @@ -163,7 +167,8 @@ static void simple_request_body(grpc_end2end_test_fixture f) { op->data.recv_close_on_server.cancelled = &was_cancelled; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102))); + error = grpc_call_start_batch(s, ops, op - ops, tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(102), 1); cq_expect_completion(cqv, tag(1), 1); diff --git a/test/core/end2end/tests/simple_delayed_request.c b/test/core/end2end/tests/simple_delayed_request.c index a2665d75645..750b734ee41 100644 --- a/test/core/end2end/tests/simple_delayed_request.c +++ b/test/core/end2end/tests/simple_delayed_request.c @@ -56,7 +56,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -64,7 +64,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -101,6 +102,7 @@ static void simple_delayed_request_body(grpc_end2end_test_config config, grpc_metadata_array request_metadata_recv; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; int was_cancelled = 2; @@ -108,7 +110,7 @@ static void simple_delayed_request_body(grpc_end2end_test_config config, config.init_client(f, client_args); c = grpc_channel_create_call(f->client, f->cq, "/foo", "foo.test.google.fr", - deadline); + deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -135,14 +137,15 @@ static void simple_delayed_request_body(grpc_end2end_test_config config, op->data.recv_status_on_client.status_details_capacity = &details_capacity; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1))); + error = grpc_call_start_batch(c, ops, op - ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); config.init_server(f, server_args); - GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(f->server, &s, - &call_details, - &request_metadata_recv, - f->cq, f->cq, tag(101))); + error = grpc_server_request_call(f->server, &s, &call_details, + &request_metadata_recv, f->cq, f->cq, + tag(101)); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); @@ -161,7 +164,8 @@ static void simple_delayed_request_body(grpc_end2end_test_config config, op->data.recv_close_on_server.cancelled = &was_cancelled; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102))); + error = grpc_call_start_batch(s, ops, op - ops, tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(102), 1); cq_expect_completion(cqv, tag(1), 1); diff --git a/test/core/end2end/tests/simple_request.c b/test/core/end2end/tests/simple_request.c index 6194b841d8a..e66c9f2f5a4 100644 --- a/test/core/end2end/tests/simple_request.c +++ b/test/core/end2end/tests/simple_request.c @@ -70,7 +70,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -78,7 +78,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -111,12 +112,13 @@ static void simple_request_body(grpc_end2end_test_fixture f) { grpc_metadata_array request_metadata_recv; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; int was_cancelled = 2; c = grpc_channel_create_call(f.client, f.cq, "/foo", - "foo.test.google.fr:1234", deadline); + "foo.test.google.fr:1234", deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -143,11 +145,13 @@ static void simple_request_body(grpc_end2end_test_fixture f) { op->data.recv_status_on_client.status_details_capacity = &details_capacity; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1))); + error = grpc_call_start_batch(c, ops, op - ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); - GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( - f.server, &s, &call_details, - &request_metadata_recv, f.cq, f.cq, tag(101))); + error = grpc_server_request_call(f.server, &s, &call_details, + &request_metadata_recv, f.cq, f.cq, + tag(101)); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); @@ -166,7 +170,8 @@ static void simple_request_body(grpc_end2end_test_fixture f) { op->data.recv_close_on_server.cancelled = &was_cancelled; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102))); + error = grpc_call_start_batch(s, ops, op - ops, tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(102), 1); cq_expect_completion(cqv, tag(1), 1); diff --git a/test/core/end2end/tests/simple_request_with_high_initial_sequence_number.c b/test/core/end2end/tests/simple_request_with_high_initial_sequence_number.c index 2cd638cbb95..bdbca86e572 100644 --- a/test/core/end2end/tests/simple_request_with_high_initial_sequence_number.c +++ b/test/core/end2end/tests/simple_request_with_high_initial_sequence_number.c @@ -70,7 +70,7 @@ static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, five_seconds_time()); + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -78,7 +78,8 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; 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)) + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -111,12 +112,13 @@ static void simple_request_body(grpc_end2end_test_fixture f) { grpc_metadata_array request_metadata_recv; grpc_call_details call_details; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; int was_cancelled = 2; c = grpc_channel_create_call(f.client, f.cq, "/foo", - "foo.test.google.fr:1234", deadline); + "foo.test.google.fr:1234", deadline, NULL); GPR_ASSERT(c); grpc_metadata_array_init(&initial_metadata_recv); @@ -143,11 +145,13 @@ static void simple_request_body(grpc_end2end_test_fixture f) { op->data.recv_status_on_client.status_details_capacity = &details_capacity; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1))); + error = grpc_call_start_batch(c, ops, op - ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); - GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( - f.server, &s, &call_details, - &request_metadata_recv, f.cq, f.cq, tag(101))); + error = grpc_server_request_call(f.server, &s, &call_details, + &request_metadata_recv, f.cq, f.cq, + tag(101)); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); @@ -166,7 +170,8 @@ static void simple_request_body(grpc_end2end_test_fixture f) { op->data.recv_close_on_server.cancelled = &was_cancelled; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102))); + error = grpc_call_start_batch(s, ops, op - ops, tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); cq_expect_completion(cqv, tag(102), 1); cq_expect_completion(cqv, tag(1), 1); diff --git a/test/core/fling/client.c b/test/core/fling/client.c index 2b196543792..a0e9d9a6190 100644 --- a/test/core/fling/client.c +++ b/test/core/fling/client.c @@ -89,26 +89,30 @@ static void init_ping_pong_request(void) { } static void step_ping_pong_request(void) { - call = - grpc_channel_create_call(channel, cq, "/Reflector/reflectUnary", - "localhost", gpr_inf_future(GPR_CLOCK_REALTIME)); - GPR_ASSERT(GRPC_CALL_OK == - grpc_call_start_batch(call, ops, op - ops, (void *)1)); - grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME)); + grpc_call_error error; + call = grpc_channel_create_call(channel, cq, "/Reflector/reflectUnary", + "localhost", + gpr_inf_future(GPR_CLOCK_REALTIME), + NULL); + error = grpc_call_start_batch(call, ops, op - ops, (void *)1, NULL); + GPR_ASSERT(GRPC_CALL_OK == error); + grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); grpc_call_destroy(call); grpc_byte_buffer_destroy(response_payload_recv); call = NULL; } static void init_ping_pong_stream(void) { - call = - grpc_channel_create_call(channel, cq, "/Reflector/reflectStream", - "localhost", gpr_inf_future(GPR_CLOCK_REALTIME)); + grpc_call_error error; + call = grpc_channel_create_call(channel, cq, "/Reflector/reflectStream", + "localhost", + gpr_inf_future(GPR_CLOCK_REALTIME), + NULL); stream_init_op.op = GRPC_OP_SEND_INITIAL_METADATA; stream_init_op.data.send_initial_metadata.count = 0; - GPR_ASSERT(GRPC_CALL_OK == - grpc_call_start_batch(call, &stream_init_op, 1, (void *)1)); - grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME)); + error = grpc_call_start_batch(call, &stream_init_op, 1, (void *)1, NULL); + GPR_ASSERT(GRPC_CALL_OK == error); + grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); grpc_metadata_array_init(&initial_metadata_recv); @@ -119,9 +123,10 @@ static void init_ping_pong_stream(void) { } static void step_ping_pong_stream(void) { - GPR_ASSERT(GRPC_CALL_OK == - grpc_call_start_batch(call, stream_step_ops, 2, (void *)1)); - grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME)); + grpc_call_error error; + error = grpc_call_start_batch(call, stream_step_ops, 2, (void *)1, NULL); + GPR_ASSERT(GRPC_CALL_OK == error); + grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); grpc_byte_buffer_destroy(response_payload_recv); } @@ -152,6 +157,7 @@ int main(int argc, char **argv) { int secure = 0; char *target = "localhost:443"; gpr_cmdline *cl; + grpc_event event; char *scenario_name = "ping-pong-request"; scenario sc = {NULL, NULL, NULL}; @@ -183,8 +189,8 @@ int main(int argc, char **argv) { return 1; } - channel = grpc_channel_create(target, NULL); - cq = grpc_completion_queue_create(); + channel = grpc_channel_create(target, NULL, NULL); + cq = grpc_completion_queue_create(NULL); the_buffer = grpc_raw_byte_buffer_create(&slice, payload_size); histogram = gpr_histogram_create(0.01, 60e9); @@ -210,9 +216,10 @@ int main(int argc, char **argv) { grpc_channel_destroy(channel); grpc_completion_queue_shutdown(cq); - while (grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME)) - .type != GRPC_QUEUE_SHUTDOWN) - ; + do { + event = grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), + NULL); + } while (event.type != GRPC_QUEUE_SHUTDOWN); grpc_completion_queue_destroy(cq); grpc_byte_buffer_destroy(the_buffer); gpr_slice_unref(slice); diff --git a/test/core/fling/server.c b/test/core/fling/server.c index 082bbd368a7..33a5e78251c 100644 --- a/test/core/fling/server.c +++ b/test/core/fling/server.c @@ -97,6 +97,7 @@ static void request_call(void) { static void handle_unary_method(void) { grpc_op *op; + grpc_call_error error; grpc_metadata_array_init(&initial_metadata_send); @@ -122,41 +123,47 @@ static void handle_unary_method(void) { op->data.recv_close_on_server.cancelled = &was_cancelled; op++; - GPR_ASSERT(GRPC_CALL_OK == - grpc_call_start_batch(call, unary_ops, op - unary_ops, - tag(FLING_SERVER_BATCH_OPS_FOR_UNARY))); + error = grpc_call_start_batch(call, unary_ops, op - unary_ops, + tag(FLING_SERVER_BATCH_OPS_FOR_UNARY), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); } static void send_initial_metadata(void) { + grpc_call_error error; + void *tagarg = tag(FLING_SERVER_SEND_INIT_METADATA_FOR_STREAMING); grpc_metadata_array_init(&initial_metadata_send); metadata_send_op.op = GRPC_OP_SEND_INITIAL_METADATA; metadata_send_op.data.send_initial_metadata.count = 0; - GPR_ASSERT(GRPC_CALL_OK == - grpc_call_start_batch( - call, &metadata_send_op, 1, - tag(FLING_SERVER_SEND_INIT_METADATA_FOR_STREAMING))); + error = grpc_call_start_batch(call, &metadata_send_op, 1, tagarg, NULL); + + GPR_ASSERT(GRPC_CALL_OK == error); } static void start_read_op(int t) { + grpc_call_error error; /* Starting read at server */ read_op.op = GRPC_OP_RECV_MESSAGE; read_op.data.recv_message = &payload_buffer; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(call, &read_op, 1, tag(t))); + error = grpc_call_start_batch(call, &read_op, 1, tag(t), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); } static void start_write_op(void) { + grpc_call_error error; + void *tagarg = tag(FLING_SERVER_WRITE_FOR_STREAMING); /* Starting write at server */ write_op.op = GRPC_OP_SEND_MESSAGE; if (payload_buffer == NULL) { gpr_log(GPR_INFO, "NULL payload buffer !!!"); } write_op.data.send_message = payload_buffer; - GPR_ASSERT(GRPC_CALL_OK == - grpc_call_start_batch(call, &write_op, 1, - tag(FLING_SERVER_WRITE_FOR_STREAMING))); + error = grpc_call_start_batch(call, &write_op, 1, tagarg, NULL); + GPR_ASSERT(GRPC_CALL_OK == error); } static void start_send_status(void) { + grpc_call_error error; + void *tagarg = tag(FLING_SERVER_SEND_STATUS_FOR_STREAMING); status_op[0].op = GRPC_OP_SEND_STATUS_FROM_SERVER; status_op[0].data.send_status_from_server.status = GRPC_STATUS_OK; status_op[0].data.send_status_from_server.trailing_metadata_count = 0; @@ -164,9 +171,8 @@ static void start_send_status(void) { status_op[1].op = GRPC_OP_RECV_CLOSE_ON_SERVER; status_op[1].data.recv_close_on_server.cancelled = &was_cancelled; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch( - call, status_op, 2, - tag(FLING_SERVER_SEND_STATUS_FOR_STREAMING))); + error = grpc_call_start_batch(call, status_op, 2, tagarg, NULL); + GPR_ASSERT(GRPC_CALL_OK == error); } /* We have some sort of deadlock, so let's not exit gracefully for now. @@ -205,20 +211,20 @@ int main(int argc, char **argv) { } gpr_log(GPR_INFO, "creating server on: %s", addr); - cq = grpc_completion_queue_create(); + cq = grpc_completion_queue_create(NULL); if (secure) { grpc_ssl_pem_key_cert_pair pem_key_cert_pair = {test_server1_key, test_server1_cert}; grpc_server_credentials *ssl_creds = grpc_ssl_server_credentials_create(NULL, &pem_key_cert_pair, 1); - server = grpc_server_create(NULL); + server = grpc_server_create(NULL, NULL); GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr, ssl_creds)); grpc_server_credentials_release(ssl_creds); } else { - server = grpc_server_create(NULL); + server = grpc_server_create(NULL, NULL); GPR_ASSERT(grpc_server_add_http2_port(server, addr)); } - grpc_server_register_completion_queue(server, cq); + grpc_server_register_completion_queue(server, cq, NULL); grpc_server_start(server); gpr_free(addr_buf); @@ -235,14 +241,14 @@ int main(int argc, char **argv) { gpr_log(GPR_INFO, "Shutting down due to SIGINT"); grpc_server_shutdown_and_notify(server, cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)) + cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) .type == GRPC_OP_COMPLETE); 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))); + gpr_time_from_micros(1000000, GPR_TIMESPAN)), NULL); s = ev.tag; switch (ev.type) { case GRPC_OP_COMPLETE: diff --git a/test/core/surface/completion_queue_test.c b/test/core/surface/completion_queue_test.c index 0e59ea4b226..0741ab920df 100644 --- a/test/core/surface/completion_queue_test.c +++ b/test/core/surface/completion_queue_test.c @@ -52,7 +52,7 @@ static void *create_test_tag(void) { static void shutdown_and_destroy(grpc_completion_queue *cc) { grpc_event ev; grpc_completion_queue_shutdown(cc); - ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME)); + ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), NULL); GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN); grpc_completion_queue_destroy(cc); } @@ -60,17 +60,18 @@ static void shutdown_and_destroy(grpc_completion_queue *cc) { /* ensure we can create and destroy a completion channel */ static void test_no_op(void) { LOG_TEST("test_no_op"); - shutdown_and_destroy(grpc_completion_queue_create()); + shutdown_and_destroy(grpc_completion_queue_create(NULL)); } static void test_wait_empty(void) { grpc_completion_queue *cc; + grpc_event event; LOG_TEST("test_wait_empty"); - cc = grpc_completion_queue_create(); - GPR_ASSERT(grpc_completion_queue_next(cc, gpr_now(GPR_CLOCK_REALTIME)).type == - GRPC_QUEUE_TIMEOUT); + 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); } @@ -84,12 +85,12 @@ static void test_cq_end_op(void) { LOG_TEST("test_cq_end_op"); - cc = grpc_completion_queue_create(); + cc = grpc_completion_queue_create(NULL); grpc_cq_begin_op(cc); grpc_cq_end_op(cc, tag, 1, do_nothing_end_completion, NULL, &completion); - ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME)); + ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), NULL); GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); GPR_ASSERT(ev.tag == tag); GPR_ASSERT(ev.success); @@ -99,23 +100,27 @@ static void test_cq_end_op(void) { static void test_shutdown_then_next_polling(void) { grpc_completion_queue *cc; + grpc_event event; LOG_TEST("test_shutdown_then_next_polling"); - cc = grpc_completion_queue_create(); + cc = grpc_completion_queue_create(NULL); grpc_completion_queue_shutdown(cc); - GPR_ASSERT(grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME)) - .type == GRPC_QUEUE_SHUTDOWN); + event = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), + NULL); + GPR_ASSERT(event.type == GRPC_QUEUE_SHUTDOWN); grpc_completion_queue_destroy(cc); } static void test_shutdown_then_next_with_timeout(void) { grpc_completion_queue *cc; + grpc_event event; LOG_TEST("test_shutdown_then_next_with_timeout"); - cc = grpc_completion_queue_create(); + cc = grpc_completion_queue_create(NULL); grpc_completion_queue_shutdown(cc); - GPR_ASSERT(grpc_completion_queue_next(cc, gpr_inf_future(GPR_CLOCK_REALTIME)) - .type == GRPC_QUEUE_SHUTDOWN); + event = grpc_completion_queue_next(cc, gpr_inf_future(GPR_CLOCK_REALTIME), + NULL); + GPR_ASSERT(event.type == GRPC_QUEUE_SHUTDOWN); grpc_completion_queue_destroy(cc); } @@ -135,7 +140,7 @@ static void test_pluck(void) { } } - cc = grpc_completion_queue_create(); + cc = grpc_completion_queue_create(NULL); for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { grpc_cq_begin_op(cc); @@ -145,7 +150,7 @@ static void test_pluck(void) { for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { ev = grpc_completion_queue_pluck(cc, tags[i], - gpr_inf_past(GPR_CLOCK_REALTIME)); + gpr_inf_past(GPR_CLOCK_REALTIME), NULL); GPR_ASSERT(ev.tag == tags[i]); } @@ -157,7 +162,7 @@ static void test_pluck(void) { for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { ev = grpc_completion_queue_pluck(cc, tags[GPR_ARRAY_SIZE(tags) - i - 1], - gpr_inf_past(GPR_CLOCK_REALTIME)); + gpr_inf_past(GPR_CLOCK_REALTIME), NULL); GPR_ASSERT(ev.tag == tags[GPR_ARRAY_SIZE(tags) - i - 1]); } @@ -229,7 +234,7 @@ static void consumer_thread(void *arg) { gpr_log(GPR_INFO, "consumer %d phase 2", opt->id); for (;;) { - ev = grpc_completion_queue_next(opt->cc, ten_seconds_time()); + ev = grpc_completion_queue_next(opt->cc, ten_seconds_time(), NULL); switch (ev.type) { case GRPC_OP_COMPLETE: GPR_ASSERT(ev.success); @@ -251,7 +256,7 @@ static void test_threading(int producers, int 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(); + grpc_completion_queue *cc = grpc_completion_queue_create(NULL); int i; int total_consumed = 0; static int optid = 101; diff --git a/test/core/surface/lame_client_test.c b/test/core/surface/lame_client_test.c index b2facd33b1f..744f9ddcdb1 100644 --- a/test/core/surface/lame_client_test.c +++ b/test/core/surface/lame_client_test.c @@ -49,6 +49,7 @@ int main(int argc, char **argv) { grpc_op *op; grpc_metadata_array trailing_metadata_recv; grpc_status_code status; + grpc_call_error error; char *details = NULL; size_t details_capacity = 0; @@ -59,9 +60,9 @@ int main(int argc, char **argv) { chan = grpc_lame_client_channel_create(); GPR_ASSERT(chan); - cq = grpc_completion_queue_create(); + cq = grpc_completion_queue_create(NULL); call = grpc_channel_create_call(chan, cq, "/Foo", "anywhere", - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(100)); + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(100), NULL); GPR_ASSERT(call); cqv = cq_verifier_create(cq); @@ -77,8 +78,8 @@ int main(int argc, char **argv) { op->data.recv_status_on_client.status_details_capacity = &details_capacity; op->flags = 0; op++; - GPR_ASSERT(GRPC_CALL_OK == - grpc_call_start_batch(call, ops, op - ops, tag(1))); + error = grpc_call_start_batch(call, ops, op - ops, tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); /* the call should immediately fail */ cq_expect_completion(cqv, tag(1), 1);