Remove shutdown_cq from grpc_end2end_test_fixture (#29049)

* Remove some shutdown_cq instances

* Remove shutdown_cq from grpc_end2end_test_fixture
pull/29054/head
Yash Tibrewal 3 years ago committed by GitHub
parent 6ba998854f
commit bd357f9a37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      test/core/end2end/dualstack_socket_test.cc
  2. 1
      test/core/end2end/end2end_tests.h
  3. 1
      test/core/end2end/fixtures/h2_census.cc
  4. 1
      test/core/end2end/fixtures/h2_compress.cc
  5. 1
      test/core/end2end/fixtures/h2_fakesec.cc
  6. 1
      test/core/end2end/fixtures/h2_fd.cc
  7. 1
      test/core/end2end/fixtures/h2_full+pipe.cc
  8. 1
      test/core/end2end/fixtures/h2_full+trace.cc
  9. 1
      test/core/end2end/fixtures/h2_full.cc
  10. 1
      test/core/end2end/fixtures/h2_http_proxy.cc
  11. 1
      test/core/end2end/fixtures/h2_insecure.cc
  12. 1
      test/core/end2end/fixtures/h2_oauth2.cc
  13. 1
      test/core/end2end/fixtures/h2_proxy.cc
  14. 1
      test/core/end2end/fixtures/h2_sockpair+trace.cc
  15. 1
      test/core/end2end/fixtures/h2_sockpair.cc
  16. 1
      test/core/end2end/fixtures/h2_sockpair_1byte.cc
  17. 1
      test/core/end2end/fixtures/h2_ssl.cc
  18. 1
      test/core/end2end/fixtures/h2_ssl_cred_reload.cc
  19. 1
      test/core/end2end/fixtures/h2_ssl_proxy.cc
  20. 4
      test/core/end2end/fixtures/h2_tls.cc
  21. 1
      test/core/end2end/fixtures/h2_uds.cc
  22. 1
      test/core/end2end/fixtures/inproc.cc
  23. 1
      test/core/end2end/fixtures/local_util.cc
  24. 14
      test/core/end2end/h2_ssl_session_reuse_test.cc
  25. 12
      test/core/end2end/inproc_callback_test.cc
  26. 14
      test/core/end2end/invalid_call_argument_test.cc
  27. 12
      test/core/end2end/tests/authority_not_supported.cc
  28. 12
      test/core/end2end/tests/bad_hostname.cc
  29. 1
      test/core/end2end/tests/bad_ping.cc
  30. 12
      test/core/end2end/tests/binary_metadata.cc
  31. 12
      test/core/end2end/tests/call_creds.cc
  32. 12
      test/core/end2end/tests/call_host_override.cc
  33. 12
      test/core/end2end/tests/cancel_after_accept.cc
  34. 12
      test/core/end2end/tests/cancel_after_client_done.cc
  35. 1
      test/core/end2end/tests/cancel_after_invoke.cc
  36. 12
      test/core/end2end/tests/cancel_after_round_trip.cc
  37. 12
      test/core/end2end/tests/cancel_before_invoke.cc
  38. 12
      test/core/end2end/tests/cancel_in_a_vacuum.cc
  39. 1
      test/core/end2end/tests/cancel_with_status.cc
  40. 12
      test/core/end2end/tests/channelz.cc
  41. 12
      test/core/end2end/tests/client_streaming.cc
  42. 12
      test/core/end2end/tests/compressed_payload.cc
  43. 5
      test/core/end2end/tests/connectivity.cc
  44. 12
      test/core/end2end/tests/default_host.cc
  45. 3
      test/core/end2end/tests/disappearing_server.cc
  46. 12
      test/core/end2end/tests/empty_batch.cc
  47. 12
      test/core/end2end/tests/filter_causes_close.cc
  48. 12
      test/core/end2end/tests/filter_context.cc
  49. 12
      test/core/end2end/tests/filter_init_fails.cc
  50. 12
      test/core/end2end/tests/filter_latency.cc
  51. 12
      test/core/end2end/tests/filter_status_code.cc
  52. 2
      test/core/end2end/tests/graceful_server_shutdown.cc
  53. 12
      test/core/end2end/tests/grpc_authz.cc
  54. 12
      test/core/end2end/tests/high_initial_seqno.cc
  55. 12
      test/core/end2end/tests/hpack_size.cc
  56. 12
      test/core/end2end/tests/invoke_large_request.cc
  57. 12
      test/core/end2end/tests/keepalive_timeout.cc
  58. 12
      test/core/end2end/tests/large_metadata.cc
  59. 12
      test/core/end2end/tests/load_reporting_hook.cc
  60. 12
      test/core/end2end/tests/max_concurrent_streams.cc
  61. 1
      test/core/end2end/tests/max_connection_age.cc
  62. 1
      test/core/end2end/tests/max_connection_idle.cc
  63. 1
      test/core/end2end/tests/max_message_length.cc
  64. 12
      test/core/end2end/tests/negative_deadline.cc
  65. 12
      test/core/end2end/tests/no_error_on_hotpath.cc
  66. 12
      test/core/end2end/tests/no_logging.cc
  67. 12
      test/core/end2end/tests/no_op.cc
  68. 12
      test/core/end2end/tests/payload.cc
  69. 2
      test/core/end2end/tests/ping.cc
  70. 12
      test/core/end2end/tests/ping_pong_streaming.cc
  71. 12
      test/core/end2end/tests/proxy_auth.cc
  72. 12
      test/core/end2end/tests/registered_call.cc
  73. 12
      test/core/end2end/tests/request_with_flags.cc
  74. 12
      test/core/end2end/tests/request_with_payload.cc
  75. 12
      test/core/end2end/tests/resource_quota_server.cc
  76. 12
      test/core/end2end/tests/retry.cc
  77. 12
      test/core/end2end/tests/retry_cancel_after_first_attempt_starts.cc
  78. 12
      test/core/end2end/tests/retry_cancel_during_delay.cc
  79. 12
      test/core/end2end/tests/retry_cancel_with_multiple_send_batches.cc
  80. 12
      test/core/end2end/tests/retry_cancellation.cc
  81. 12
      test/core/end2end/tests/retry_disabled.cc
  82. 12
      test/core/end2end/tests/retry_exceeds_buffer_size_in_delay.cc
  83. 12
      test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc
  84. 12
      test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc
  85. 12
      test/core/end2end/tests/retry_lb_drop.cc
  86. 12
      test/core/end2end/tests/retry_lb_fail.cc
  87. 12
      test/core/end2end/tests/retry_non_retriable_status.cc
  88. 12
      test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc
  89. 12
      test/core/end2end/tests/retry_per_attempt_recv_timeout.cc
  90. 12
      test/core/end2end/tests/retry_per_attempt_recv_timeout_on_last_attempt.cc
  91. 12
      test/core/end2end/tests/retry_recv_initial_metadata.cc
  92. 12
      test/core/end2end/tests/retry_recv_message.cc
  93. 12
      test/core/end2end/tests/retry_recv_message_replay.cc
  94. 12
      test/core/end2end/tests/retry_recv_trailing_metadata_error.cc
  95. 12
      test/core/end2end/tests/retry_send_initial_metadata_refs.cc
  96. 12
      test/core/end2end/tests/retry_send_op_fails.cc
  97. 12
      test/core/end2end/tests/retry_server_pushback_delay.cc
  98. 12
      test/core/end2end/tests/retry_server_pushback_disabled.cc
  99. 12
      test/core/end2end/tests/retry_streaming.cc
  100. 12
      test/core/end2end/tests/retry_streaming_after_commit.cc
  101. Some files were not shown because too many files have changed in this diff Show More

@ -78,7 +78,6 @@ void test_connect(const char* server_host, const char* client_host, int port,
grpc_channel* client; grpc_channel* client;
grpc_server* server; grpc_server* server;
grpc_completion_queue* cq; grpc_completion_queue* cq;
grpc_completion_queue* shutdown_cq;
grpc_call* c; grpc_call* c;
grpc_call* s; grpc_call* s;
cq_verifier* cqv; cq_verifier* cqv;
@ -257,14 +256,14 @@ void test_connect(const char* server_host, const char* client_host, int port,
grpc_channel_destroy(client); grpc_channel_destroy(client);
/* Destroy server. */ /* Destroy server. */
shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); grpc_server_shutdown_and_notify(server, cq, tag(1000));
grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000)); grpc_event ev;
GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, tag(1000), do {
grpc_timeout_seconds_to_deadline(5), ev = grpc_completion_queue_next(cq, grpc_timeout_seconds_to_deadline(5),
nullptr) nullptr);
.type == GRPC_OP_COMPLETE); } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(server); grpc_server_destroy(server);
grpc_completion_queue_destroy(shutdown_cq);
grpc_completion_queue_shutdown(cq); grpc_completion_queue_shutdown(cq);
drain_cq(cq); drain_cq(cq);
grpc_completion_queue_destroy(cq); grpc_completion_queue_destroy(cq);

@ -45,7 +45,6 @@ typedef struct grpc_end2end_test_config grpc_end2end_test_config;
struct grpc_end2end_test_fixture { struct grpc_end2end_test_fixture {
grpc_completion_queue* cq; grpc_completion_queue* cq;
grpc_completion_queue* shutdown_cq;
grpc_server* server; grpc_server* server;
grpc_channel* client; grpc_channel* client;
void* fixture_data; void* fixture_data;

@ -50,7 +50,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create_for_next(nullptr); f.cq = grpc_completion_queue_create_for_next(nullptr);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f; return f;
} }

@ -58,7 +58,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack_compression(
memset(&f, 0, sizeof(f)); memset(&f, 0, sizeof(f));
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create_for_next(nullptr); f.cq = grpc_completion_queue_create_for_next(nullptr);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f; return f;
} }

@ -44,7 +44,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create_for_next(nullptr); f.cq = grpc_completion_queue_create_for_next(nullptr);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f; return f;
} }

@ -61,7 +61,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair(
memset(&f, 0, sizeof(f)); memset(&f, 0, sizeof(f));
f.fixture_data = fixture_data; f.fixture_data = fixture_data;
f.cq = grpc_completion_queue_create_for_next(nullptr); f.cq = grpc_completion_queue_create_for_next(nullptr);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
create_sockets(fixture_data->fd_pair); create_sockets(fixture_data->fd_pair);

@ -56,7 +56,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create_for_next(nullptr); f.cq = grpc_completion_queue_create_for_next(nullptr);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f; return f;
} }

@ -55,7 +55,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create_for_next(nullptr); f.cq = grpc_completion_queue_create_for_next(nullptr);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f; return f;
} }

@ -50,7 +50,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create_for_next(nullptr); f.cq = grpc_completion_queue_create_for_next(nullptr);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f; return f;
} }

@ -61,7 +61,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create_for_next(nullptr); f.cq = grpc_completion_queue_create_for_next(nullptr);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f; return f;
} }

@ -45,7 +45,6 @@ grpc_end2end_test_fixture Chttp2CreateFixtureInsecureFullstack(
ffd->localaddr = grpc_core::JoinHostPort("localhost", port); ffd->localaddr = grpc_core::JoinHostPort("localhost", port);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create_for_next(nullptr); f.cq = grpc_completion_queue_create_for_next(nullptr);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f; return f;
} }

@ -106,7 +106,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
ffd->tls_version = tls_version; ffd->tls_version = tls_version;
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create_for_next(nullptr); f.cq = grpc_completion_queue_create_for_next(nullptr);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f; return f;
} }

@ -71,7 +71,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create_for_next(nullptr); f.cq = grpc_completion_queue_create_for_next(nullptr);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f; return f;
} }

@ -107,7 +107,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair(
memset(&f, 0, sizeof(f)); memset(&f, 0, sizeof(f));
f.fixture_data = fixture_data; f.fixture_data = fixture_data;
f.cq = grpc_completion_queue_create_for_next(nullptr); f.cq = grpc_completion_queue_create_for_next(nullptr);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
fixture_data->ep = grpc_iomgr_create_endpoint_pair("fixture", nullptr); fixture_data->ep = grpc_iomgr_create_endpoint_pair("fixture", nullptr);
return f; return f;
} }

@ -103,7 +103,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair(
memset(&f, 0, sizeof(f)); memset(&f, 0, sizeof(f));
f.fixture_data = fixture_data; f.fixture_data = fixture_data;
f.cq = grpc_completion_queue_create_for_next(nullptr); f.cq = grpc_completion_queue_create_for_next(nullptr);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
fixture_data->ep = grpc_iomgr_create_endpoint_pair("fixture", nullptr); fixture_data->ep = grpc_iomgr_create_endpoint_pair("fixture", nullptr);
return f; return f;
} }

@ -103,7 +103,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair(
memset(&f, 0, sizeof(f)); memset(&f, 0, sizeof(f));
f.fixture_data = fixture_data; f.fixture_data = fixture_data;
f.cq = grpc_completion_queue_create_for_next(nullptr); f.cq = grpc_completion_queue_create_for_next(nullptr);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
grpc_arg a[3]; grpc_arg a[3];
a[0].key = const_cast<char*>(GRPC_ARG_TCP_READ_CHUNK_SIZE); a[0].key = const_cast<char*>(GRPC_ARG_TCP_READ_CHUNK_SIZE);
a[0].type = GRPC_ARG_INTEGER; a[0].type = GRPC_ARG_INTEGER;

@ -56,7 +56,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create_for_next(nullptr); f.cq = grpc_completion_queue_create_for_next(nullptr);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f; return f;
} }

@ -91,7 +91,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create_for_next(nullptr); f.cq = grpc_completion_queue_create_for_next(nullptr);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f; return f;
} }

@ -99,7 +99,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create_for_next(nullptr); f.cq = grpc_completion_queue_create_for_next(nullptr);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f; return f;
} }

@ -186,7 +186,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_simple_fullstack(
ffd, SecurityPrimitives::VerifierType::EXTERNAL_SYNC_VERIFIER); ffd, SecurityPrimitives::VerifierType::EXTERNAL_SYNC_VERIFIER);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create_for_next(nullptr); f.cq = grpc_completion_queue_create_for_next(nullptr);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f; return f;
} }
@ -204,7 +203,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_async_verifier(
ffd, SecurityPrimitives::VerifierType::EXTERNAL_ASYNC_VERIFIER); ffd, SecurityPrimitives::VerifierType::EXTERNAL_ASYNC_VERIFIER);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create_for_next(nullptr); f.cq = grpc_completion_queue_create_for_next(nullptr);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f; return f;
} }
@ -222,7 +220,6 @@ chttp2_create_fixture_hostname_verifier_cert_watcher(const grpc_channel_args*,
SecurityPrimitives::VerifierType::HOSTNAME_VERIFIER); SecurityPrimitives::VerifierType::HOSTNAME_VERIFIER);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create_for_next(nullptr); f.cq = grpc_completion_queue_create_for_next(nullptr);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f; return f;
} }
@ -240,7 +237,6 @@ chttp2_create_fixture_async_verifier_cert_watcher(const grpc_channel_args*,
ffd, SecurityPrimitives::VerifierType::EXTERNAL_ASYNC_VERIFIER); ffd, SecurityPrimitives::VerifierType::EXTERNAL_ASYNC_VERIFIER);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create_for_next(nullptr); f.cq = grpc_completion_queue_create_for_next(nullptr);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f; return f;
} }

@ -56,7 +56,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack_base(
memset(&f, 0, sizeof(f)); memset(&f, 0, sizeof(f));
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create_for_next(nullptr); f.cq = grpc_completion_queue_create_for_next(nullptr);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f; return f;
} }

@ -46,7 +46,6 @@ static grpc_end2end_test_fixture inproc_create_fixture(
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create_for_next(nullptr); f.cq = grpc_completion_queue_create_for_next(nullptr);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f; return f;
} }

@ -40,7 +40,6 @@ grpc_end2end_test_fixture grpc_end2end_local_chttp2_create_fixture_fullstack() {
memset(&f, 0, sizeof(f)); memset(&f, 0, sizeof(f));
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create_for_next(nullptr); f.cq = grpc_completion_queue_create_for_next(nullptr);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f; return f;
} }

@ -267,15 +267,13 @@ TEST(H2SessionReuseTest, SingleReuse) {
cq, grpc_timeout_milliseconds_to_deadline(100), nullptr) cq, grpc_timeout_milliseconds_to_deadline(100), nullptr)
.type == GRPC_QUEUE_TIMEOUT); .type == GRPC_QUEUE_TIMEOUT);
grpc_completion_queue* shutdown_cq = grpc_server_shutdown_and_notify(server, cq, tag(1000));
grpc_completion_queue_create_for_pluck(nullptr); grpc_event ev;
grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000)); do {
GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, tag(1000), ev = grpc_completion_queue_next(cq, grpc_timeout_seconds_to_deadline(5),
grpc_timeout_seconds_to_deadline(5), nullptr);
nullptr) } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
.type == GRPC_OP_COMPLETE);
grpc_server_destroy(server); grpc_server_destroy(server);
grpc_completion_queue_destroy(shutdown_cq);
grpc_completion_queue_shutdown(cq); grpc_completion_queue_shutdown(cq);
drain_cq(cq); drain_cq(cq);

@ -216,7 +216,6 @@ static grpc_end2end_test_fixture inproc_create_fixture(
g_shutdown_callback = new ShutdownCallback(); g_shutdown_callback = new ShutdownCallback();
f.cq = f.cq =
grpc_completion_queue_create_for_callback(g_shutdown_callback, nullptr); grpc_completion_queue_create_for_callback(g_shutdown_callback, nullptr);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f; return f;
} }
@ -269,13 +268,9 @@ static void drain_cq(grpc_completion_queue* /*cq*/) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify( grpc_server_shutdown_and_notify(f->server, f->cq, tag(1));
f->server, f->shutdown_cq, expect_tag(1, true);
reinterpret_cast<void*>(static_cast<intptr_t>(1000))); verify_tags(five_seconds_from_now());
GPR_ASSERT(
grpc_completion_queue_pluck(f->shutdown_cq, (void*)((intptr_t)1000),
grpc_timeout_seconds_to_deadline(5), nullptr)
.type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -293,7 +288,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
static void simple_request_body(grpc_end2end_test_config /* config */, static void simple_request_body(grpc_end2end_test_config /* config */,

@ -118,7 +118,6 @@ static void prepare_test(int is_client) {
} }
static void cleanup_test() { static void cleanup_test() {
grpc_completion_queue* shutdown_cq;
grpc_call_unref(g_state.call); grpc_call_unref(g_state.call);
cq_verifier_destroy(g_state.cqv); cq_verifier_destroy(g_state.cqv);
grpc_channel_destroy(g_state.chan); grpc_channel_destroy(g_state.chan);
@ -127,14 +126,13 @@ static void cleanup_test() {
grpc_metadata_array_destroy(&g_state.trailing_metadata_recv); grpc_metadata_array_destroy(&g_state.trailing_metadata_recv);
if (!g_state.is_client) { if (!g_state.is_client) {
shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
grpc_call_unref(g_state.server_call); grpc_call_unref(g_state.server_call);
grpc_server_shutdown_and_notify(g_state.server, shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(g_state.server, g_state.cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(
.type == GRPC_OP_COMPLETE); g_state.cq, grpc_timeout_seconds_to_deadline(5), nullptr);
grpc_completion_queue_destroy(shutdown_cq); } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(g_state.server); grpc_server_destroy(g_state.server);
grpc_call_details_destroy(&g_state.call_details); grpc_call_details_destroy(&g_state.call_details);
grpc_metadata_array_destroy(&g_state.server_initial_metadata_recv); grpc_metadata_array_destroy(&g_state.server_initial_metadata_recv);

@ -58,11 +58,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -80,7 +81,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
/* Request/response with metadata and payload.*/ /* Request/response with metadata and payload.*/

@ -60,11 +60,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -82,7 +83,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
static void simple_request_body(grpc_end2end_test_fixture f) { static void simple_request_body(grpc_end2end_test_fixture f) {

@ -60,7 +60,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Send more pings than server allows to trigger server's GOAWAY. // Send more pings than server allows to trigger server's GOAWAY.

@ -69,11 +69,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -91,7 +92,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
/* Request/response with metadata and payload.*/ /* Request/response with metadata and payload.*/

@ -86,11 +86,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -108,7 +109,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
static void print_auth_context(int is_client, const grpc_auth_context* ctx) { static void print_auth_context(int is_client, const grpc_auth_context* ctx) {

@ -68,11 +68,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -90,7 +91,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
static void test_invoke_simple_request(grpc_end2end_test_config config) { static void test_invoke_simple_request(grpc_end2end_test_config config) {

@ -66,11 +66,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -88,7 +89,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
/* Cancel after accept, no payload */ /* Cancel after accept, no payload */

@ -62,11 +62,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -84,7 +85,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
/* Cancel after accept with a writes closed, no payload */ /* Cancel after accept with a writes closed, no payload */

@ -86,7 +86,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
/* Cancel after invoke, no payload */ /* Cancel after invoke, no payload */

@ -66,11 +66,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -88,7 +89,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
/* Cancel after accept, no payload */ /* Cancel after accept, no payload */

@ -61,11 +61,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -83,7 +84,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
/* Cancel before invoke */ /* Cancel before invoke */

@ -62,11 +62,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -84,7 +85,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
/* Cancel and do nothing */ /* Cancel and do nothing */

@ -86,7 +86,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
static void simple_request_body(grpc_end2end_test_config /*config*/, static void simple_request_body(grpc_end2end_test_config /*config*/,

@ -63,11 +63,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -85,7 +86,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
static void run_one_request(grpc_end2end_test_config /*config*/, static void run_one_request(grpc_end2end_test_config /*config*/,

@ -58,11 +58,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -80,7 +81,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Client streaming test where the client sends a bunch of messages and the // Client streaming test where the client sends a bunch of messages and the

@ -70,11 +70,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -92,7 +93,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
static void request_for_disabled_algorithm( static void request_for_disabled_algorithm(

@ -166,8 +166,6 @@ static void test_connectivity(grpc_end2end_test_config config) {
grpc_completion_queue_shutdown(f.cq); grpc_completion_queue_shutdown(f.cq);
grpc_completion_queue_destroy(f.cq); grpc_completion_queue_destroy(f.cq);
/* shutdown_cq is not used in this test */
grpc_completion_queue_destroy(f.shutdown_cq);
config.tear_down_data(&f); config.tear_down_data(&f);
cq_verifier_destroy(cqv); cq_verifier_destroy(cqv);
@ -230,9 +228,8 @@ static void test_watch_connectivity_cq_callback(
grpc_channel_destroy(f.client); grpc_channel_destroy(f.client);
grpc_completion_queue_destroy(cq); grpc_completion_queue_destroy(cq);
/* shutdown_cq and cq are not used in this test */ /* cq is not used in this test */
grpc_completion_queue_destroy(f.cq); grpc_completion_queue_destroy(f.cq);
grpc_completion_queue_destroy(f.shutdown_cq);
config.tear_down_data(&f); config.tear_down_data(&f);
} }

@ -60,11 +60,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -82,7 +83,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
static void test_invoke_simple_request(grpc_end2end_test_config config) { static void test_invoke_simple_request(grpc_end2end_test_config config) {

@ -63,9 +63,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
/* Note: shutdown_cq was unused in this test */
grpc_completion_queue_destroy(f->shutdown_cq);
} }
static void do_request_and_shutdown_server(grpc_end2end_test_config /*config*/, static void do_request_and_shutdown_server(grpc_end2end_test_config /*config*/,

@ -60,11 +60,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -82,7 +83,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
static void empty_batch_body(grpc_end2end_test_config /*config*/, static void empty_batch_body(grpc_end2end_test_config /*config*/,

@ -62,11 +62,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -84,7 +85,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
/* Simple request via a server filter that always closes the stream.*/ /* Simple request via a server filter that always closes the stream.*/

@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Simple request to test that filters see a consistent view of the // Simple request to test that filters see a consistent view of the

@ -70,11 +70,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -92,7 +93,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Simple request via a SERVER_CHANNEL filter that always fails to // Simple request via a SERVER_CHANNEL filter that always fails to

@ -69,11 +69,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -91,7 +92,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Simple request via a server filter that saves the reported latency value. // Simple request via a server filter that saves the reported latency value.

@ -82,11 +82,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -104,7 +105,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Simple request via a server filter that saves the reported status code. // Simple request via a server filter that saves the reported status code.

@ -75,8 +75,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
/* Note: shutdown_cq is not used in this test */
grpc_completion_queue_destroy(f->shutdown_cq);
} }
static void test_early_server_shutdown_finishes_inflight_calls( static void test_early_server_shutdown_finishes_inflight_calls(

@ -60,11 +60,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -82,7 +83,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
static void test_allow_authorized_request(grpc_end2end_test_fixture f) { static void test_allow_authorized_request(grpc_end2end_test_fixture f) {

@ -64,11 +64,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -86,7 +87,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
static void simple_request_body(grpc_end2end_test_config /*config*/, static void simple_request_body(grpc_end2end_test_config /*config*/,

@ -205,11 +205,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -227,7 +228,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
static void simple_request_body(grpc_end2end_test_config /*config*/, static void simple_request_body(grpc_end2end_test_config /*config*/,

@ -59,11 +59,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -81,7 +82,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
static grpc_slice large_slice(void) { static grpc_slice large_slice(void) {

@ -67,11 +67,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_event ev;
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), do {
five_seconds_from_now(), nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -89,7 +90,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
/* Client sends a request, server replies with a payload, then waits for the /* Client sends a request, server replies with a payload, then waits for the

@ -58,11 +58,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -80,7 +81,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Request with a large amount of metadata. // Request with a large amount of metadata.

@ -83,11 +83,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -105,7 +106,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
static void request_response_with_payload( static void request_response_with_payload(

@ -58,11 +58,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -80,7 +81,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
static void simple_request_body(grpc_end2end_test_config /*config*/, static void simple_request_body(grpc_end2end_test_config /*config*/,

@ -73,7 +73,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
static void test_max_age_forcibly_close(grpc_end2end_test_config config) { static void test_max_age_forcibly_close(grpc_end2end_test_config config) {

@ -225,7 +225,6 @@ static void test_max_connection_idle(grpc_end2end_test_config config) {
grpc_completion_queue_shutdown(f.cq); grpc_completion_queue_shutdown(f.cq);
drain_cq(f.cq); drain_cq(f.cq);
grpc_completion_queue_destroy(f.cq); grpc_completion_queue_destroy(f.cq);
grpc_completion_queue_destroy(f.shutdown_cq);
config.tear_down_data(&f); config.tear_down_data(&f);
cq_verifier_destroy(cqv); cq_verifier_destroy(cqv);

@ -87,7 +87,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Test with request larger than the limit. // Test with request larger than the limit.

@ -61,11 +61,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -83,7 +84,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
static void simple_request_body(grpc_end2end_test_config /*config*/, static void simple_request_body(grpc_end2end_test_config /*config*/,

@ -62,11 +62,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -84,7 +85,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
static void simple_request_body(grpc_end2end_test_config /*config*/, static void simple_request_body(grpc_end2end_test_config /*config*/,

@ -90,11 +90,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -112,7 +113,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
static void simple_request_body(grpc_end2end_test_config /*config*/, static void simple_request_body(grpc_end2end_test_config /*config*/,

@ -58,11 +58,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -80,7 +81,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
static void test_no_op(grpc_end2end_test_config config) { static void test_no_op(grpc_end2end_test_config config) {

@ -58,11 +58,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -80,7 +81,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
/* Creates and returns a grpc_slice containing random alphanumeric characters. /* Creates and returns a grpc_slice containing random alphanumeric characters.

@ -95,8 +95,6 @@ static void test_ping(grpc_end2end_test_config config,
grpc_completion_queue_shutdown(f.cq); grpc_completion_queue_shutdown(f.cq);
grpc_completion_queue_destroy(f.cq); grpc_completion_queue_destroy(f.cq);
/* f.shutdown_cq is not used in this test */
grpc_completion_queue_destroy(f.shutdown_cq);
config.tear_down_data(&f); config.tear_down_data(&f);
cq_verifier_destroy(cqv); cq_verifier_destroy(cqv);

@ -58,11 +58,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -80,7 +81,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
/* Client pings and server pongs. Repeat messages rounds before finishing. */ /* Client pings and server pongs. Repeat messages rounds before finishing. */

@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
static void simple_request_body(grpc_end2end_test_config /*config*/, static void simple_request_body(grpc_end2end_test_config /*config*/,

@ -60,11 +60,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -82,7 +83,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
static void simple_request_body(grpc_end2end_test_config /*config*/, static void simple_request_body(grpc_end2end_test_config /*config*/,

@ -58,11 +58,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -80,7 +81,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
static void test_invoke_request_with_flags( static void test_invoke_request_with_flags(

@ -58,11 +58,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -80,7 +81,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
/* Client sends a request with payload, server reads then returns status. */ /* Client sends a request with payload, server reads then returns status. */

@ -58,11 +58,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -80,7 +81,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
/* Creates and returns a grpc_slice containing random alphanumeric characters. /* Creates and returns a grpc_slice containing random alphanumeric characters.

@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Tests a basic retry scenario: // Tests a basic retry scenario:

@ -63,11 +63,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -85,7 +86,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Tests that we can unref a call after the first attempt starts but // Tests that we can unref a call after the first attempt starts but

@ -66,11 +66,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -88,7 +89,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Tests retry cancellation during backoff. // Tests retry cancellation during backoff.

@ -71,11 +71,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -93,7 +94,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Tests cancellation with multiple send op batches. // Tests cancellation with multiple send op batches.

@ -68,11 +68,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -90,7 +91,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Tests retry cancellation. // Tests retry cancellation.

@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Tests that we don't retry when retries are disabled via the // Tests that we don't retry when retries are disabled via the

@ -63,11 +63,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -85,7 +86,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Tests the case where the retry buffer size is exceeded during backoff. // Tests the case where the retry buffer size is exceeded during backoff.

@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Tests that we don't make any further attempts after we exceed the // Tests that we don't make any further attempts after we exceed the

@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Similar to the retry_exceeds_buffer_size_in_initial_batch test, but we // Similar to the retry_exceeds_buffer_size_in_initial_batch test, but we

@ -130,11 +130,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -152,7 +153,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Tests that we don't retry when the LB policy drops a call, // Tests that we don't retry when the LB policy drops a call,

@ -131,11 +131,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -153,7 +154,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Tests that we retry properly when the LB policy fails the call before // Tests that we retry properly when the LB policy fails the call before

@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Tests that we don't retry for non-retryable status codes. // Tests that we don't retry for non-retryable status codes.

@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Tests that we don't retry for non-retryable status codes, even if // Tests that we don't retry for non-retryable status codes, even if

@ -63,11 +63,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -85,7 +86,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Tests perAttemptRecvTimeout: // Tests perAttemptRecvTimeout:

@ -63,11 +63,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -85,7 +86,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Tests perAttemptRecvTimeout: // Tests perAttemptRecvTimeout:

@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Tests that receiving initial metadata commits the call. // Tests that receiving initial metadata commits the call.

@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Tests that receiving a message commits the call. // Tests that receiving a message commits the call.

@ -69,11 +69,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -91,7 +92,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Tests the fix for a bug found in real-world code where recv_message // Tests the fix for a bug found in real-world code where recv_message

@ -67,11 +67,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -89,7 +90,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Tests that we honor the error passed to recv_trailing_metadata_ready // Tests that we honor the error passed to recv_trailing_metadata_ready

@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Tests that we hold refs to send_initial_metadata payload while // Tests that we hold refs to send_initial_metadata payload while

@ -69,11 +69,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -91,7 +92,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Tests failure on a send op batch: // Tests failure on a send op batch:

@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Tests that we honor server push-back delay. // Tests that we honor server push-back delay.

@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Tests that we don't retry when disabled by server push-back. // Tests that we don't retry when disabled by server push-back.

@ -67,11 +67,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -89,7 +90,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Tests retrying a streaming RPC. This is the same as // Tests retrying a streaming RPC. This is the same as

@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) {
static void shutdown_server(grpc_end2end_test_fixture* f) { static void shutdown_server(grpc_end2end_test_fixture* f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), grpc_event ev;
grpc_timeout_seconds_to_deadline(5), do {
nullptr) ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
.type == GRPC_OP_COMPLETE); nullptr);
} while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = nullptr; f->server = nullptr;
} }
@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
// Tests that we can continue to send/recv messages on a streaming call // Tests that we can continue to send/recv messages on a streaming call

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save