diff --git a/test/core/end2end/dualstack_socket_test.cc b/test/core/end2end/dualstack_socket_test.cc index ba85e61081f..a907087843b 100644 --- a/test/core/end2end/dualstack_socket_test.cc +++ b/test/core/end2end/dualstack_socket_test.cc @@ -78,7 +78,6 @@ void test_connect(const char* server_host, const char* client_host, int port, grpc_channel* client; grpc_server* server; grpc_completion_queue* cq; - grpc_completion_queue* shutdown_cq; grpc_call* c; grpc_call* s; cq_verifier* cqv; @@ -257,14 +256,14 @@ void test_connect(const char* server_host, const char* client_host, int port, grpc_channel_destroy(client); /* Destroy server. */ - shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); - grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(server, cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); + grpc_server_destroy(server); - grpc_completion_queue_destroy(shutdown_cq); grpc_completion_queue_shutdown(cq); drain_cq(cq); grpc_completion_queue_destroy(cq); diff --git a/test/core/end2end/end2end_tests.h b/test/core/end2end/end2end_tests.h index 1a0e4bac5b0..aafef3aaaf1 100644 --- a/test/core/end2end/end2end_tests.h +++ b/test/core/end2end/end2end_tests.h @@ -45,7 +45,6 @@ typedef struct grpc_end2end_test_config grpc_end2end_test_config; struct grpc_end2end_test_fixture { grpc_completion_queue* cq; - grpc_completion_queue* shutdown_cq; grpc_server* server; grpc_channel* client; void* fixture_data; diff --git a/test/core/end2end/fixtures/h2_census.cc b/test/core/end2end/fixtures/h2_census.cc index 47c407ac9c6..84a785407f8 100644 --- a/test/core/end2end/fixtures/h2_census.cc +++ b/test/core/end2end/fixtures/h2_census.cc @@ -50,7 +50,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( f.fixture_data = ffd; f.cq = grpc_completion_queue_create_for_next(nullptr); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); return f; } diff --git a/test/core/end2end/fixtures/h2_compress.cc b/test/core/end2end/fixtures/h2_compress.cc index c91cfe98685..958cf6ffbc1 100644 --- a/test/core/end2end/fixtures/h2_compress.cc +++ b/test/core/end2end/fixtures/h2_compress.cc @@ -58,7 +58,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack_compression( memset(&f, 0, sizeof(f)); f.fixture_data = ffd; f.cq = grpc_completion_queue_create_for_next(nullptr); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); return f; } diff --git a/test/core/end2end/fixtures/h2_fakesec.cc b/test/core/end2end/fixtures/h2_fakesec.cc index 72000e4b8ed..ccae12a6bf9 100644 --- a/test/core/end2end/fixtures/h2_fakesec.cc +++ b/test/core/end2end/fixtures/h2_fakesec.cc @@ -44,7 +44,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( f.fixture_data = ffd; f.cq = grpc_completion_queue_create_for_next(nullptr); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); return f; } diff --git a/test/core/end2end/fixtures/h2_fd.cc b/test/core/end2end/fixtures/h2_fd.cc index d08e816837d..55fd405e805 100644 --- a/test/core/end2end/fixtures/h2_fd.cc +++ b/test/core/end2end/fixtures/h2_fd.cc @@ -61,7 +61,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( memset(&f, 0, sizeof(f)); f.fixture_data = fixture_data; 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); diff --git a/test/core/end2end/fixtures/h2_full+pipe.cc b/test/core/end2end/fixtures/h2_full+pipe.cc index 64f36a5f93d..b834e5d4cf2 100644 --- a/test/core/end2end/fixtures/h2_full+pipe.cc +++ b/test/core/end2end/fixtures/h2_full+pipe.cc @@ -56,7 +56,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( f.fixture_data = ffd; f.cq = grpc_completion_queue_create_for_next(nullptr); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); return f; } diff --git a/test/core/end2end/fixtures/h2_full+trace.cc b/test/core/end2end/fixtures/h2_full+trace.cc index 54cfe1b1b07..d29971c6284 100644 --- a/test/core/end2end/fixtures/h2_full+trace.cc +++ b/test/core/end2end/fixtures/h2_full+trace.cc @@ -55,7 +55,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( f.fixture_data = ffd; f.cq = grpc_completion_queue_create_for_next(nullptr); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); return f; } diff --git a/test/core/end2end/fixtures/h2_full.cc b/test/core/end2end/fixtures/h2_full.cc index 89951e5f0c6..16b6a09aabf 100644 --- a/test/core/end2end/fixtures/h2_full.cc +++ b/test/core/end2end/fixtures/h2_full.cc @@ -50,7 +50,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( f.fixture_data = ffd; f.cq = grpc_completion_queue_create_for_next(nullptr); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); return f; } diff --git a/test/core/end2end/fixtures/h2_http_proxy.cc b/test/core/end2end/fixtures/h2_http_proxy.cc index 3e1f9366199..f67aca5f9fe 100644 --- a/test/core/end2end/fixtures/h2_http_proxy.cc +++ b/test/core/end2end/fixtures/h2_http_proxy.cc @@ -61,7 +61,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( f.fixture_data = ffd; f.cq = grpc_completion_queue_create_for_next(nullptr); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); return f; } diff --git a/test/core/end2end/fixtures/h2_insecure.cc b/test/core/end2end/fixtures/h2_insecure.cc index 2d5bbafbece..26f79264fc2 100644 --- a/test/core/end2end/fixtures/h2_insecure.cc +++ b/test/core/end2end/fixtures/h2_insecure.cc @@ -45,7 +45,6 @@ grpc_end2end_test_fixture Chttp2CreateFixtureInsecureFullstack( ffd->localaddr = grpc_core::JoinHostPort("localhost", port); f.fixture_data = ffd; f.cq = grpc_completion_queue_create_for_next(nullptr); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); return f; } diff --git a/test/core/end2end/fixtures/h2_oauth2.cc b/test/core/end2end/fixtures/h2_oauth2.cc index 857a3a534c2..4dc99d3a2cf 100644 --- a/test/core/end2end/fixtures/h2_oauth2.cc +++ b/test/core/end2end/fixtures/h2_oauth2.cc @@ -106,7 +106,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( ffd->tls_version = tls_version; f.fixture_data = ffd; f.cq = grpc_completion_queue_create_for_next(nullptr); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); return f; } diff --git a/test/core/end2end/fixtures/h2_proxy.cc b/test/core/end2end/fixtures/h2_proxy.cc index d2042b5ce97..905e04e9659 100644 --- a/test/core/end2end/fixtures/h2_proxy.cc +++ b/test/core/end2end/fixtures/h2_proxy.cc @@ -71,7 +71,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( f.fixture_data = ffd; f.cq = grpc_completion_queue_create_for_next(nullptr); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); return f; } diff --git a/test/core/end2end/fixtures/h2_sockpair+trace.cc b/test/core/end2end/fixtures/h2_sockpair+trace.cc index 65cc3c14f2f..45e88a95818 100644 --- a/test/core/end2end/fixtures/h2_sockpair+trace.cc +++ b/test/core/end2end/fixtures/h2_sockpair+trace.cc @@ -107,7 +107,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( memset(&f, 0, sizeof(f)); f.fixture_data = fixture_data; 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); return f; } diff --git a/test/core/end2end/fixtures/h2_sockpair.cc b/test/core/end2end/fixtures/h2_sockpair.cc index 6e91c209dd1..a2154266759 100644 --- a/test/core/end2end/fixtures/h2_sockpair.cc +++ b/test/core/end2end/fixtures/h2_sockpair.cc @@ -103,7 +103,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( memset(&f, 0, sizeof(f)); f.fixture_data = fixture_data; 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); return f; } diff --git a/test/core/end2end/fixtures/h2_sockpair_1byte.cc b/test/core/end2end/fixtures/h2_sockpair_1byte.cc index 404454c86fc..15c79b46557 100644 --- a/test/core/end2end/fixtures/h2_sockpair_1byte.cc +++ b/test/core/end2end/fixtures/h2_sockpair_1byte.cc @@ -103,7 +103,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( memset(&f, 0, sizeof(f)); f.fixture_data = fixture_data; f.cq = grpc_completion_queue_create_for_next(nullptr); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); grpc_arg a[3]; a[0].key = const_cast(GRPC_ARG_TCP_READ_CHUNK_SIZE); a[0].type = GRPC_ARG_INTEGER; diff --git a/test/core/end2end/fixtures/h2_ssl.cc b/test/core/end2end/fixtures/h2_ssl.cc index 39d9a94f211..4c412c719d4 100644 --- a/test/core/end2end/fixtures/h2_ssl.cc +++ b/test/core/end2end/fixtures/h2_ssl.cc @@ -56,7 +56,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( f.fixture_data = ffd; f.cq = grpc_completion_queue_create_for_next(nullptr); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); return f; } diff --git a/test/core/end2end/fixtures/h2_ssl_cred_reload.cc b/test/core/end2end/fixtures/h2_ssl_cred_reload.cc index b59c6df58f9..7152c976a08 100644 --- a/test/core/end2end/fixtures/h2_ssl_cred_reload.cc +++ b/test/core/end2end/fixtures/h2_ssl_cred_reload.cc @@ -91,7 +91,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( f.fixture_data = ffd; f.cq = grpc_completion_queue_create_for_next(nullptr); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); return f; } diff --git a/test/core/end2end/fixtures/h2_ssl_proxy.cc b/test/core/end2end/fixtures/h2_ssl_proxy.cc index 76a4e9eb220..acb090ac766 100644 --- a/test/core/end2end/fixtures/h2_ssl_proxy.cc +++ b/test/core/end2end/fixtures/h2_ssl_proxy.cc @@ -99,7 +99,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( f.fixture_data = ffd; f.cq = grpc_completion_queue_create_for_next(nullptr); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); return f; } diff --git a/test/core/end2end/fixtures/h2_tls.cc b/test/core/end2end/fixtures/h2_tls.cc index 020d8cd44c4..82c27c0d926 100644 --- a/test/core/end2end/fixtures/h2_tls.cc +++ b/test/core/end2end/fixtures/h2_tls.cc @@ -186,7 +186,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_simple_fullstack( ffd, SecurityPrimitives::VerifierType::EXTERNAL_SYNC_VERIFIER); f.fixture_data = ffd; f.cq = grpc_completion_queue_create_for_next(nullptr); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); return f; } @@ -204,7 +203,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_async_verifier( ffd, SecurityPrimitives::VerifierType::EXTERNAL_ASYNC_VERIFIER); f.fixture_data = ffd; f.cq = grpc_completion_queue_create_for_next(nullptr); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); return f; } @@ -222,7 +220,6 @@ chttp2_create_fixture_hostname_verifier_cert_watcher(const grpc_channel_args*, SecurityPrimitives::VerifierType::HOSTNAME_VERIFIER); f.fixture_data = ffd; f.cq = grpc_completion_queue_create_for_next(nullptr); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); return f; } @@ -240,7 +237,6 @@ chttp2_create_fixture_async_verifier_cert_watcher(const grpc_channel_args*, ffd, SecurityPrimitives::VerifierType::EXTERNAL_ASYNC_VERIFIER); f.fixture_data = ffd; f.cq = grpc_completion_queue_create_for_next(nullptr); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); return f; } diff --git a/test/core/end2end/fixtures/h2_uds.cc b/test/core/end2end/fixtures/h2_uds.cc index 5a14e11058c..ed88ba83e36 100644 --- a/test/core/end2end/fixtures/h2_uds.cc +++ b/test/core/end2end/fixtures/h2_uds.cc @@ -56,7 +56,6 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack_base( memset(&f, 0, sizeof(f)); f.fixture_data = ffd; f.cq = grpc_completion_queue_create_for_next(nullptr); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); return f; } diff --git a/test/core/end2end/fixtures/inproc.cc b/test/core/end2end/fixtures/inproc.cc index c2035bac85a..a0561e65137 100644 --- a/test/core/end2end/fixtures/inproc.cc +++ b/test/core/end2end/fixtures/inproc.cc @@ -46,7 +46,6 @@ static grpc_end2end_test_fixture inproc_create_fixture( f.fixture_data = ffd; f.cq = grpc_completion_queue_create_for_next(nullptr); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); return f; } diff --git a/test/core/end2end/fixtures/local_util.cc b/test/core/end2end/fixtures/local_util.cc index 0ecf4b1165c..16fe4d0cfbe 100644 --- a/test/core/end2end/fixtures/local_util.cc +++ b/test/core/end2end/fixtures/local_util.cc @@ -40,7 +40,6 @@ grpc_end2end_test_fixture grpc_end2end_local_chttp2_create_fixture_fullstack() { memset(&f, 0, sizeof(f)); f.fixture_data = ffd; f.cq = grpc_completion_queue_create_for_next(nullptr); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); return f; } diff --git a/test/core/end2end/h2_ssl_session_reuse_test.cc b/test/core/end2end/h2_ssl_session_reuse_test.cc index c3907665832..4c45c6e1a16 100644 --- a/test/core/end2end/h2_ssl_session_reuse_test.cc +++ b/test/core/end2end/h2_ssl_session_reuse_test.cc @@ -267,15 +267,13 @@ TEST(H2SessionReuseTest, SingleReuse) { cq, grpc_timeout_milliseconds_to_deadline(100), nullptr) .type == GRPC_QUEUE_TIMEOUT); - grpc_completion_queue* shutdown_cq = - grpc_completion_queue_create_for_pluck(nullptr); - grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(server, cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(server); - grpc_completion_queue_destroy(shutdown_cq); grpc_completion_queue_shutdown(cq); drain_cq(cq); diff --git a/test/core/end2end/inproc_callback_test.cc b/test/core/end2end/inproc_callback_test.cc index 94c2153e5a5..7376fc1a89d 100644 --- a/test/core/end2end/inproc_callback_test.cc +++ b/test/core/end2end/inproc_callback_test.cc @@ -216,7 +216,6 @@ static grpc_end2end_test_fixture inproc_create_fixture( g_shutdown_callback = new ShutdownCallback(); f.cq = grpc_completion_queue_create_for_callback(g_shutdown_callback, nullptr); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); return f; } @@ -269,13 +268,9 @@ static void drain_cq(grpc_completion_queue* /*cq*/) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify( - f->server, f->shutdown_cq, - reinterpret_cast(static_cast(1000))); - 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_shutdown_and_notify(f->server, f->cq, tag(1)); + expect_tag(1, true); + verify_tags(five_seconds_from_now()); grpc_server_destroy(f->server); f->server = nullptr; } @@ -293,7 +288,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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 */, diff --git a/test/core/end2end/invalid_call_argument_test.cc b/test/core/end2end/invalid_call_argument_test.cc index cfec589a4dc..5a17d31b4b1 100644 --- a/test/core/end2end/invalid_call_argument_test.cc +++ b/test/core/end2end/invalid_call_argument_test.cc @@ -118,7 +118,6 @@ static void prepare_test(int is_client) { } static void cleanup_test() { - grpc_completion_queue* shutdown_cq; grpc_call_unref(g_state.call); cq_verifier_destroy(g_state.cqv); grpc_channel_destroy(g_state.chan); @@ -127,14 +126,13 @@ static void cleanup_test() { grpc_metadata_array_destroy(&g_state.trailing_metadata_recv); if (!g_state.is_client) { - shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); grpc_call_unref(g_state.server_call); - grpc_server_shutdown_and_notify(g_state.server, shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); - grpc_completion_queue_destroy(shutdown_cq); + grpc_server_shutdown_and_notify(g_state.server, g_state.cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next( + g_state.cq, grpc_timeout_seconds_to_deadline(5), nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(g_state.server); grpc_call_details_destroy(&g_state.call_details); grpc_metadata_array_destroy(&g_state.server_initial_metadata_recv); diff --git a/test/core/end2end/tests/authority_not_supported.cc b/test/core/end2end/tests/authority_not_supported.cc index 806215e18d4..4b4f1f1f59f 100644 --- a/test/core/end2end/tests/authority_not_supported.cc +++ b/test/core/end2end/tests/authority_not_supported.cc @@ -58,11 +58,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -80,7 +81,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Request/response with metadata and payload.*/ diff --git a/test/core/end2end/tests/bad_hostname.cc b/test/core/end2end/tests/bad_hostname.cc index a2caf88e2dc..a261bd67617 100644 --- a/test/core/end2end/tests/bad_hostname.cc +++ b/test/core/end2end/tests/bad_hostname.cc @@ -60,11 +60,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -82,7 +83,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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) { diff --git a/test/core/end2end/tests/bad_ping.cc b/test/core/end2end/tests/bad_ping.cc index d957f583ebe..9b4eaa21d62 100644 --- a/test/core/end2end/tests/bad_ping.cc +++ b/test/core/end2end/tests/bad_ping.cc @@ -60,7 +60,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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. diff --git a/test/core/end2end/tests/binary_metadata.cc b/test/core/end2end/tests/binary_metadata.cc index f2989e645c0..9dc12d9e4e8 100644 --- a/test/core/end2end/tests/binary_metadata.cc +++ b/test/core/end2end/tests/binary_metadata.cc @@ -69,11 +69,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -91,7 +92,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Request/response with metadata and payload.*/ diff --git a/test/core/end2end/tests/call_creds.cc b/test/core/end2end/tests/call_creds.cc index 4a59369af03..90b3fc3aaef 100644 --- a/test/core/end2end/tests/call_creds.cc +++ b/test/core/end2end/tests/call_creds.cc @@ -86,11 +86,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -108,7 +109,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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) { diff --git a/test/core/end2end/tests/call_host_override.cc b/test/core/end2end/tests/call_host_override.cc index 04d718d4447..abf54a892f6 100644 --- a/test/core/end2end/tests/call_host_override.cc +++ b/test/core/end2end/tests/call_host_override.cc @@ -68,11 +68,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -90,7 +91,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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) { diff --git a/test/core/end2end/tests/cancel_after_accept.cc b/test/core/end2end/tests/cancel_after_accept.cc index 3ae1615085f..ed919462404 100644 --- a/test/core/end2end/tests/cancel_after_accept.cc +++ b/test/core/end2end/tests/cancel_after_accept.cc @@ -66,11 +66,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -88,7 +89,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Cancel after accept, no payload */ diff --git a/test/core/end2end/tests/cancel_after_client_done.cc b/test/core/end2end/tests/cancel_after_client_done.cc index 1039d9b3247..ea2ff8b0aef 100644 --- a/test/core/end2end/tests/cancel_after_client_done.cc +++ b/test/core/end2end/tests/cancel_after_client_done.cc @@ -62,11 +62,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -84,7 +85,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Cancel after accept with a writes closed, no payload */ diff --git a/test/core/end2end/tests/cancel_after_invoke.cc b/test/core/end2end/tests/cancel_after_invoke.cc index 0195dd1c182..4e38f026892 100644 --- a/test/core/end2end/tests/cancel_after_invoke.cc +++ b/test/core/end2end/tests/cancel_after_invoke.cc @@ -86,7 +86,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Cancel after invoke, no payload */ diff --git a/test/core/end2end/tests/cancel_after_round_trip.cc b/test/core/end2end/tests/cancel_after_round_trip.cc index e47a505499e..d4945530ed4 100644 --- a/test/core/end2end/tests/cancel_after_round_trip.cc +++ b/test/core/end2end/tests/cancel_after_round_trip.cc @@ -66,11 +66,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -88,7 +89,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Cancel after accept, no payload */ diff --git a/test/core/end2end/tests/cancel_before_invoke.cc b/test/core/end2end/tests/cancel_before_invoke.cc index 748219327bc..ffc1254e778 100644 --- a/test/core/end2end/tests/cancel_before_invoke.cc +++ b/test/core/end2end/tests/cancel_before_invoke.cc @@ -61,11 +61,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -83,7 +84,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Cancel before invoke */ diff --git a/test/core/end2end/tests/cancel_in_a_vacuum.cc b/test/core/end2end/tests/cancel_in_a_vacuum.cc index e004cee0d9c..375f38523c3 100644 --- a/test/core/end2end/tests/cancel_in_a_vacuum.cc +++ b/test/core/end2end/tests/cancel_in_a_vacuum.cc @@ -62,11 +62,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -84,7 +85,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Cancel and do nothing */ diff --git a/test/core/end2end/tests/cancel_with_status.cc b/test/core/end2end/tests/cancel_with_status.cc index 98c83c5fc11..dec05e8d7db 100644 --- a/test/core/end2end/tests/cancel_with_status.cc +++ b/test/core/end2end/tests/cancel_with_status.cc @@ -86,7 +86,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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*/, diff --git a/test/core/end2end/tests/channelz.cc b/test/core/end2end/tests/channelz.cc index 179cf12a6a8..71165e5df4a 100644 --- a/test/core/end2end/tests/channelz.cc +++ b/test/core/end2end/tests/channelz.cc @@ -63,11 +63,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -85,7 +86,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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*/, diff --git a/test/core/end2end/tests/client_streaming.cc b/test/core/end2end/tests/client_streaming.cc index 6b62a0101c5..284062dd176 100644 --- a/test/core/end2end/tests/client_streaming.cc +++ b/test/core/end2end/tests/client_streaming.cc @@ -58,11 +58,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -80,7 +81,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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 diff --git a/test/core/end2end/tests/compressed_payload.cc b/test/core/end2end/tests/compressed_payload.cc index e2759585f0d..6af554d2902 100644 --- a/test/core/end2end/tests/compressed_payload.cc +++ b/test/core/end2end/tests/compressed_payload.cc @@ -70,11 +70,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -92,7 +93,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } static void request_for_disabled_algorithm( diff --git a/test/core/end2end/tests/connectivity.cc b/test/core/end2end/tests/connectivity.cc index 326b7bf8569..c082c097cf0 100644 --- a/test/core/end2end/tests/connectivity.cc +++ b/test/core/end2end/tests/connectivity.cc @@ -166,8 +166,6 @@ static void test_connectivity(grpc_end2end_test_config config) { grpc_completion_queue_shutdown(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); cq_verifier_destroy(cqv); @@ -230,9 +228,8 @@ static void test_watch_connectivity_cq_callback( grpc_channel_destroy(f.client); 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.shutdown_cq); config.tear_down_data(&f); } diff --git a/test/core/end2end/tests/default_host.cc b/test/core/end2end/tests/default_host.cc index efd4fea9e04..c450675c28f 100644 --- a/test/core/end2end/tests/default_host.cc +++ b/test/core/end2end/tests/default_host.cc @@ -60,11 +60,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -82,7 +83,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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) { diff --git a/test/core/end2end/tests/disappearing_server.cc b/test/core/end2end/tests/disappearing_server.cc index 6f4493cca57..45c6bd44037 100644 --- a/test/core/end2end/tests/disappearing_server.cc +++ b/test/core/end2end/tests/disappearing_server.cc @@ -63,9 +63,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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*/, diff --git a/test/core/end2end/tests/empty_batch.cc b/test/core/end2end/tests/empty_batch.cc index 3104c5d0ad5..b7538bb0177 100644 --- a/test/core/end2end/tests/empty_batch.cc +++ b/test/core/end2end/tests/empty_batch.cc @@ -60,11 +60,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -82,7 +83,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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*/, diff --git a/test/core/end2end/tests/filter_causes_close.cc b/test/core/end2end/tests/filter_causes_close.cc index ac3fe788334..eabed9bbfa3 100644 --- a/test/core/end2end/tests/filter_causes_close.cc +++ b/test/core/end2end/tests/filter_causes_close.cc @@ -62,11 +62,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -84,7 +85,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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.*/ diff --git a/test/core/end2end/tests/filter_context.cc b/test/core/end2end/tests/filter_context.cc index cb93ecda26a..9cd6a82cc9b 100644 --- a/test/core/end2end/tests/filter_context.cc +++ b/test/core/end2end/tests/filter_context.cc @@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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 diff --git a/test/core/end2end/tests/filter_init_fails.cc b/test/core/end2end/tests/filter_init_fails.cc index eb4a64cfa88..cc10a65691f 100644 --- a/test/core/end2end/tests/filter_init_fails.cc +++ b/test/core/end2end/tests/filter_init_fails.cc @@ -70,11 +70,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -92,7 +93,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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 diff --git a/test/core/end2end/tests/filter_latency.cc b/test/core/end2end/tests/filter_latency.cc index ac35c11f081..16a0b48fa42 100644 --- a/test/core/end2end/tests/filter_latency.cc +++ b/test/core/end2end/tests/filter_latency.cc @@ -69,11 +69,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -91,7 +92,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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. diff --git a/test/core/end2end/tests/filter_status_code.cc b/test/core/end2end/tests/filter_status_code.cc index 586f7722735..c7312258806 100644 --- a/test/core/end2end/tests/filter_status_code.cc +++ b/test/core/end2end/tests/filter_status_code.cc @@ -82,11 +82,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -104,7 +105,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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. diff --git a/test/core/end2end/tests/graceful_server_shutdown.cc b/test/core/end2end/tests/graceful_server_shutdown.cc index 8dc56ff0868..87d0a3b5a91 100644 --- a/test/core/end2end/tests/graceful_server_shutdown.cc +++ b/test/core/end2end/tests/graceful_server_shutdown.cc @@ -75,8 +75,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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( diff --git a/test/core/end2end/tests/grpc_authz.cc b/test/core/end2end/tests/grpc_authz.cc index f9fe1a28b8e..6c5ef98441e 100644 --- a/test/core/end2end/tests/grpc_authz.cc +++ b/test/core/end2end/tests/grpc_authz.cc @@ -60,11 +60,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -82,7 +83,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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) { diff --git a/test/core/end2end/tests/high_initial_seqno.cc b/test/core/end2end/tests/high_initial_seqno.cc index 9772601e651..03f824af338 100644 --- a/test/core/end2end/tests/high_initial_seqno.cc +++ b/test/core/end2end/tests/high_initial_seqno.cc @@ -64,11 +64,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -86,7 +87,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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*/, diff --git a/test/core/end2end/tests/hpack_size.cc b/test/core/end2end/tests/hpack_size.cc index ca1410229e9..5cf684762af 100644 --- a/test/core/end2end/tests/hpack_size.cc +++ b/test/core/end2end/tests/hpack_size.cc @@ -205,11 +205,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -227,7 +228,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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*/, diff --git a/test/core/end2end/tests/invoke_large_request.cc b/test/core/end2end/tests/invoke_large_request.cc index 2fff0cc00a6..d9731e9ffaf 100644 --- a/test/core/end2end/tests/invoke_large_request.cc +++ b/test/core/end2end/tests/invoke_large_request.cc @@ -59,11 +59,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -81,7 +82,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } static grpc_slice large_slice(void) { diff --git a/test/core/end2end/tests/keepalive_timeout.cc b/test/core/end2end/tests/keepalive_timeout.cc index 6db92f2c9db..e1ec6b881f5 100644 --- a/test/core/end2end/tests/keepalive_timeout.cc +++ b/test/core/end2end/tests/keepalive_timeout.cc @@ -67,11 +67,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - five_seconds_from_now(), nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -89,7 +90,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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 diff --git a/test/core/end2end/tests/large_metadata.cc b/test/core/end2end/tests/large_metadata.cc index 19ac61a2bd2..72cf519899e 100644 --- a/test/core/end2end/tests/large_metadata.cc +++ b/test/core/end2end/tests/large_metadata.cc @@ -58,11 +58,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -80,7 +81,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } // Request with a large amount of metadata. diff --git a/test/core/end2end/tests/load_reporting_hook.cc b/test/core/end2end/tests/load_reporting_hook.cc index 31b96532684..01ca4d5a597 100644 --- a/test/core/end2end/tests/load_reporting_hook.cc +++ b/test/core/end2end/tests/load_reporting_hook.cc @@ -83,11 +83,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -105,7 +106,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } static void request_response_with_payload( diff --git a/test/core/end2end/tests/max_concurrent_streams.cc b/test/core/end2end/tests/max_concurrent_streams.cc index 3d3e4063705..b3fbf760a88 100644 --- a/test/core/end2end/tests/max_concurrent_streams.cc +++ b/test/core/end2end/tests/max_concurrent_streams.cc @@ -58,11 +58,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -80,7 +81,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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*/, diff --git a/test/core/end2end/tests/max_connection_age.cc b/test/core/end2end/tests/max_connection_age.cc index 3219b60e8fa..99a5b0d2dca 100644 --- a/test/core/end2end/tests/max_connection_age.cc +++ b/test/core/end2end/tests/max_connection_age.cc @@ -73,7 +73,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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) { diff --git a/test/core/end2end/tests/max_connection_idle.cc b/test/core/end2end/tests/max_connection_idle.cc index ecc51b54665..54de91f71c3 100644 --- a/test/core/end2end/tests/max_connection_idle.cc +++ b/test/core/end2end/tests/max_connection_idle.cc @@ -225,7 +225,6 @@ static void test_max_connection_idle(grpc_end2end_test_config config) { grpc_completion_queue_shutdown(f.cq); drain_cq(f.cq); grpc_completion_queue_destroy(f.cq); - grpc_completion_queue_destroy(f.shutdown_cq); config.tear_down_data(&f); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/max_message_length.cc b/test/core/end2end/tests/max_message_length.cc index ec8943648ed..52f960b7a5f 100644 --- a/test/core/end2end/tests/max_message_length.cc +++ b/test/core/end2end/tests/max_message_length.cc @@ -87,7 +87,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } // Test with request larger than the limit. diff --git a/test/core/end2end/tests/negative_deadline.cc b/test/core/end2end/tests/negative_deadline.cc index a2d1528eb88..e9b101d360c 100644 --- a/test/core/end2end/tests/negative_deadline.cc +++ b/test/core/end2end/tests/negative_deadline.cc @@ -61,11 +61,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -83,7 +84,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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*/, diff --git a/test/core/end2end/tests/no_error_on_hotpath.cc b/test/core/end2end/tests/no_error_on_hotpath.cc index 59ea65bcd11..f18fbcba804 100644 --- a/test/core/end2end/tests/no_error_on_hotpath.cc +++ b/test/core/end2end/tests/no_error_on_hotpath.cc @@ -62,11 +62,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -84,7 +85,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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*/, diff --git a/test/core/end2end/tests/no_logging.cc b/test/core/end2end/tests/no_logging.cc index 7ca364c2b73..2a98165ac77 100644 --- a/test/core/end2end/tests/no_logging.cc +++ b/test/core/end2end/tests/no_logging.cc @@ -90,11 +90,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -112,7 +113,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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*/, diff --git a/test/core/end2end/tests/no_op.cc b/test/core/end2end/tests/no_op.cc index 1f3343cff4a..f671b5b7783 100644 --- a/test/core/end2end/tests/no_op.cc +++ b/test/core/end2end/tests/no_op.cc @@ -58,11 +58,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -80,7 +81,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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) { diff --git a/test/core/end2end/tests/payload.cc b/test/core/end2end/tests/payload.cc index fd4565c14d0..9f628e6e636 100644 --- a/test/core/end2end/tests/payload.cc +++ b/test/core/end2end/tests/payload.cc @@ -58,11 +58,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -80,7 +81,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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. diff --git a/test/core/end2end/tests/ping.cc b/test/core/end2end/tests/ping.cc index db4d54525cd..dedc8a2458d 100644 --- a/test/core/end2end/tests/ping.cc +++ b/test/core/end2end/tests/ping.cc @@ -95,8 +95,6 @@ static void test_ping(grpc_end2end_test_config config, grpc_completion_queue_shutdown(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); cq_verifier_destroy(cqv); diff --git a/test/core/end2end/tests/ping_pong_streaming.cc b/test/core/end2end/tests/ping_pong_streaming.cc index 66c60c3ed94..83684738a72 100644 --- a/test/core/end2end/tests/ping_pong_streaming.cc +++ b/test/core/end2end/tests/ping_pong_streaming.cc @@ -58,11 +58,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -80,7 +81,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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. */ diff --git a/test/core/end2end/tests/proxy_auth.cc b/test/core/end2end/tests/proxy_auth.cc index 738387aaee4..b2633db7fa9 100644 --- a/test/core/end2end/tests/proxy_auth.cc +++ b/test/core/end2end/tests/proxy_auth.cc @@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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*/, diff --git a/test/core/end2end/tests/registered_call.cc b/test/core/end2end/tests/registered_call.cc index b7c0258f83f..60103b784de 100644 --- a/test/core/end2end/tests/registered_call.cc +++ b/test/core/end2end/tests/registered_call.cc @@ -60,11 +60,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -82,7 +83,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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*/, diff --git a/test/core/end2end/tests/request_with_flags.cc b/test/core/end2end/tests/request_with_flags.cc index 3f42b609b8c..59e137aeca3 100644 --- a/test/core/end2end/tests/request_with_flags.cc +++ b/test/core/end2end/tests/request_with_flags.cc @@ -58,11 +58,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -80,7 +81,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } static void test_invoke_request_with_flags( diff --git a/test/core/end2end/tests/request_with_payload.cc b/test/core/end2end/tests/request_with_payload.cc index 1a655c1ba58..cb0c4699dcf 100644 --- a/test/core/end2end/tests/request_with_payload.cc +++ b/test/core/end2end/tests/request_with_payload.cc @@ -58,11 +58,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -80,7 +81,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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. */ diff --git a/test/core/end2end/tests/resource_quota_server.cc b/test/core/end2end/tests/resource_quota_server.cc index 0e5e50d6337..2c3a95ff1fe 100644 --- a/test/core/end2end/tests/resource_quota_server.cc +++ b/test/core/end2end/tests/resource_quota_server.cc @@ -58,11 +58,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -80,7 +81,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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. diff --git a/test/core/end2end/tests/retry.cc b/test/core/end2end/tests/retry.cc index ba8d4f5e9c1..e5caf053072 100644 --- a/test/core/end2end/tests/retry.cc +++ b/test/core/end2end/tests/retry.cc @@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } // Tests a basic retry scenario: diff --git a/test/core/end2end/tests/retry_cancel_after_first_attempt_starts.cc b/test/core/end2end/tests/retry_cancel_after_first_attempt_starts.cc index 88d9adfcfe5..39dcae5b15d 100644 --- a/test/core/end2end/tests/retry_cancel_after_first_attempt_starts.cc +++ b/test/core/end2end/tests/retry_cancel_after_first_attempt_starts.cc @@ -63,11 +63,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -85,7 +86,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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 diff --git a/test/core/end2end/tests/retry_cancel_during_delay.cc b/test/core/end2end/tests/retry_cancel_during_delay.cc index 8d30aac7d70..d5992a76f70 100644 --- a/test/core/end2end/tests/retry_cancel_during_delay.cc +++ b/test/core/end2end/tests/retry_cancel_during_delay.cc @@ -66,11 +66,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -88,7 +89,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } // Tests retry cancellation during backoff. diff --git a/test/core/end2end/tests/retry_cancel_with_multiple_send_batches.cc b/test/core/end2end/tests/retry_cancel_with_multiple_send_batches.cc index 3b929afc460..b89d7e758ff 100644 --- a/test/core/end2end/tests/retry_cancel_with_multiple_send_batches.cc +++ b/test/core/end2end/tests/retry_cancel_with_multiple_send_batches.cc @@ -71,11 +71,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -93,7 +94,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } // Tests cancellation with multiple send op batches. diff --git a/test/core/end2end/tests/retry_cancellation.cc b/test/core/end2end/tests/retry_cancellation.cc index 416c34f4057..ec44e9f5d9f 100644 --- a/test/core/end2end/tests/retry_cancellation.cc +++ b/test/core/end2end/tests/retry_cancellation.cc @@ -68,11 +68,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -90,7 +91,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } // Tests retry cancellation. diff --git a/test/core/end2end/tests/retry_disabled.cc b/test/core/end2end/tests/retry_disabled.cc index f03b40310f4..48d18c9fa33 100644 --- a/test/core/end2end/tests/retry_disabled.cc +++ b/test/core/end2end/tests/retry_disabled.cc @@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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 diff --git a/test/core/end2end/tests/retry_exceeds_buffer_size_in_delay.cc b/test/core/end2end/tests/retry_exceeds_buffer_size_in_delay.cc index 9241b636d87..208e56b5535 100644 --- a/test/core/end2end/tests/retry_exceeds_buffer_size_in_delay.cc +++ b/test/core/end2end/tests/retry_exceeds_buffer_size_in_delay.cc @@ -63,11 +63,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -85,7 +86,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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. diff --git a/test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc b/test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc index 395b8812c2f..1ca73f4cebc 100644 --- a/test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc +++ b/test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc @@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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 diff --git a/test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc b/test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc index 59b6544fb2f..cf0b4181f60 100644 --- a/test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc +++ b/test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc @@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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 diff --git a/test/core/end2end/tests/retry_lb_drop.cc b/test/core/end2end/tests/retry_lb_drop.cc index ffd81a0f6aa..82569440a1a 100644 --- a/test/core/end2end/tests/retry_lb_drop.cc +++ b/test/core/end2end/tests/retry_lb_drop.cc @@ -130,11 +130,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -152,7 +153,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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, diff --git a/test/core/end2end/tests/retry_lb_fail.cc b/test/core/end2end/tests/retry_lb_fail.cc index 729b8913376..55cd2688eab 100644 --- a/test/core/end2end/tests/retry_lb_fail.cc +++ b/test/core/end2end/tests/retry_lb_fail.cc @@ -131,11 +131,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -153,7 +154,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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 diff --git a/test/core/end2end/tests/retry_non_retriable_status.cc b/test/core/end2end/tests/retry_non_retriable_status.cc index ec2c5325ff2..8dd3859c646 100644 --- a/test/core/end2end/tests/retry_non_retriable_status.cc +++ b/test/core/end2end/tests/retry_non_retriable_status.cc @@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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. diff --git a/test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc b/test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc index 005017cc638..7a7538c6fdb 100644 --- a/test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc +++ b/test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc @@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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 diff --git a/test/core/end2end/tests/retry_per_attempt_recv_timeout.cc b/test/core/end2end/tests/retry_per_attempt_recv_timeout.cc index d081258d8a6..c28b887b503 100644 --- a/test/core/end2end/tests/retry_per_attempt_recv_timeout.cc +++ b/test/core/end2end/tests/retry_per_attempt_recv_timeout.cc @@ -63,11 +63,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -85,7 +86,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } // Tests perAttemptRecvTimeout: diff --git a/test/core/end2end/tests/retry_per_attempt_recv_timeout_on_last_attempt.cc b/test/core/end2end/tests/retry_per_attempt_recv_timeout_on_last_attempt.cc index cb9003c7a1f..47c60c915a7 100644 --- a/test/core/end2end/tests/retry_per_attempt_recv_timeout_on_last_attempt.cc +++ b/test/core/end2end/tests/retry_per_attempt_recv_timeout_on_last_attempt.cc @@ -63,11 +63,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -85,7 +86,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } // Tests perAttemptRecvTimeout: diff --git a/test/core/end2end/tests/retry_recv_initial_metadata.cc b/test/core/end2end/tests/retry_recv_initial_metadata.cc index 2b68b28482b..77504b54c27 100644 --- a/test/core/end2end/tests/retry_recv_initial_metadata.cc +++ b/test/core/end2end/tests/retry_recv_initial_metadata.cc @@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } // Tests that receiving initial metadata commits the call. diff --git a/test/core/end2end/tests/retry_recv_message.cc b/test/core/end2end/tests/retry_recv_message.cc index a1bc8884ca9..57de5efa934 100644 --- a/test/core/end2end/tests/retry_recv_message.cc +++ b/test/core/end2end/tests/retry_recv_message.cc @@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } // Tests that receiving a message commits the call. diff --git a/test/core/end2end/tests/retry_recv_message_replay.cc b/test/core/end2end/tests/retry_recv_message_replay.cc index 8d0c472a3e2..75ddd33f914 100644 --- a/test/core/end2end/tests/retry_recv_message_replay.cc +++ b/test/core/end2end/tests/retry_recv_message_replay.cc @@ -69,11 +69,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -91,7 +92,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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 diff --git a/test/core/end2end/tests/retry_recv_trailing_metadata_error.cc b/test/core/end2end/tests/retry_recv_trailing_metadata_error.cc index afa7bcecf8d..ff73ad08149 100644 --- a/test/core/end2end/tests/retry_recv_trailing_metadata_error.cc +++ b/test/core/end2end/tests/retry_recv_trailing_metadata_error.cc @@ -67,11 +67,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -89,7 +90,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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 diff --git a/test/core/end2end/tests/retry_send_initial_metadata_refs.cc b/test/core/end2end/tests/retry_send_initial_metadata_refs.cc index 588f2615bd8..b53b0cd71fa 100644 --- a/test/core/end2end/tests/retry_send_initial_metadata_refs.cc +++ b/test/core/end2end/tests/retry_send_initial_metadata_refs.cc @@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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 diff --git a/test/core/end2end/tests/retry_send_op_fails.cc b/test/core/end2end/tests/retry_send_op_fails.cc index 57d7b53c098..c8a3bf1f7dd 100644 --- a/test/core/end2end/tests/retry_send_op_fails.cc +++ b/test/core/end2end/tests/retry_send_op_fails.cc @@ -69,11 +69,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -91,7 +92,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } // Tests failure on a send op batch: diff --git a/test/core/end2end/tests/retry_server_pushback_delay.cc b/test/core/end2end/tests/retry_server_pushback_delay.cc index e80ce5be029..f35113380e3 100644 --- a/test/core/end2end/tests/retry_server_pushback_delay.cc +++ b/test/core/end2end/tests/retry_server_pushback_delay.cc @@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } // Tests that we honor server push-back delay. diff --git a/test/core/end2end/tests/retry_server_pushback_disabled.cc b/test/core/end2end/tests/retry_server_pushback_disabled.cc index 27bce9e34f3..219f3f4fff2 100644 --- a/test/core/end2end/tests/retry_server_pushback_disabled.cc +++ b/test/core/end2end/tests/retry_server_pushback_disabled.cc @@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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. diff --git a/test/core/end2end/tests/retry_streaming.cc b/test/core/end2end/tests/retry_streaming.cc index 25f0db3e0b2..8d9ca411525 100644 --- a/test/core/end2end/tests/retry_streaming.cc +++ b/test/core/end2end/tests/retry_streaming.cc @@ -67,11 +67,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -89,7 +90,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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 diff --git a/test/core/end2end/tests/retry_streaming_after_commit.cc b/test/core/end2end/tests/retry_streaming_after_commit.cc index 077a4b0c2f4..0cfc8857cfe 100644 --- a/test/core/end2end/tests/retry_streaming_after_commit.cc +++ b/test/core/end2end/tests/retry_streaming_after_commit.cc @@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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 diff --git a/test/core/end2end/tests/retry_streaming_succeeds_before_replay_finished.cc b/test/core/end2end/tests/retry_streaming_succeeds_before_replay_finished.cc index 21c544271df..9771d387d19 100644 --- a/test/core/end2end/tests/retry_streaming_succeeds_before_replay_finished.cc +++ b/test/core/end2end/tests/retry_streaming_succeeds_before_replay_finished.cc @@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } // Tests that we correctly clean up if the second attempt finishes diff --git a/test/core/end2end/tests/retry_throttled.cc b/test/core/end2end/tests/retry_throttled.cc index ac334aed885..73304856169 100644 --- a/test/core/end2end/tests/retry_throttled.cc +++ b/test/core/end2end/tests/retry_throttled.cc @@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } // Tests that we don't retry when throttled. diff --git a/test/core/end2end/tests/retry_too_many_attempts.cc b/test/core/end2end/tests/retry_too_many_attempts.cc index 4313bb8c035..a550345314b 100644 --- a/test/core/end2end/tests/retry_too_many_attempts.cc +++ b/test/core/end2end/tests/retry_too_many_attempts.cc @@ -65,11 +65,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -87,7 +88,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } // Tests that we stop retrying after the configured number of attempts. diff --git a/test/core/end2end/tests/retry_transparent_goaway.cc b/test/core/end2end/tests/retry_transparent_goaway.cc index ab5b4b4c2ac..167123d020d 100644 --- a/test/core/end2end/tests/retry_transparent_goaway.cc +++ b/test/core/end2end/tests/retry_transparent_goaway.cc @@ -68,11 +68,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -90,7 +91,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } // Tests transparent retries when the call was never sent out on the wire. diff --git a/test/core/end2end/tests/retry_transparent_max_concurrent_streams.cc b/test/core/end2end/tests/retry_transparent_max_concurrent_streams.cc index 921e416dff0..d5847c85322 100644 --- a/test/core/end2end/tests/retry_transparent_max_concurrent_streams.cc +++ b/test/core/end2end/tests/retry_transparent_max_concurrent_streams.cc @@ -68,11 +68,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -90,7 +91,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } // Tests transparent retries when the call was never sent out on the wire. diff --git a/test/core/end2end/tests/retry_transparent_not_sent_on_wire.cc b/test/core/end2end/tests/retry_transparent_not_sent_on_wire.cc index 739601d58c6..6968e375aad 100644 --- a/test/core/end2end/tests/retry_transparent_not_sent_on_wire.cc +++ b/test/core/end2end/tests/retry_transparent_not_sent_on_wire.cc @@ -68,11 +68,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -90,7 +91,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } // Tests transparent retries when the call was never sent out on the wire. diff --git a/test/core/end2end/tests/retry_unref_before_finish.cc b/test/core/end2end/tests/retry_unref_before_finish.cc index 38e3f23932b..27ebbf43628 100644 --- a/test/core/end2end/tests/retry_unref_before_finish.cc +++ b/test/core/end2end/tests/retry_unref_before_finish.cc @@ -63,11 +63,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -85,7 +86,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } // Tests that we can unref a call whose status is cached but not yet diff --git a/test/core/end2end/tests/retry_unref_before_recv.cc b/test/core/end2end/tests/retry_unref_before_recv.cc index 006a8fe9c53..1796f46bbd6 100644 --- a/test/core/end2end/tests/retry_unref_before_recv.cc +++ b/test/core/end2end/tests/retry_unref_before_recv.cc @@ -63,11 +63,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -85,7 +86,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } // Tests that we can unref a call while recv ops are started but before diff --git a/test/core/end2end/tests/server_finishes_request.cc b/test/core/end2end/tests/server_finishes_request.cc index 3c16b579521..ce017e1274d 100644 --- a/test/core/end2end/tests/server_finishes_request.cc +++ b/test/core/end2end/tests/server_finishes_request.cc @@ -60,11 +60,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -82,7 +83,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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*/, diff --git a/test/core/end2end/tests/server_streaming.cc b/test/core/end2end/tests/server_streaming.cc index f7dcf0feead..72613305a2c 100644 --- a/test/core/end2end/tests/server_streaming.cc +++ b/test/core/end2end/tests/server_streaming.cc @@ -58,11 +58,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -80,7 +81,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Client requests status along with the initial metadata. Server streams diff --git a/test/core/end2end/tests/shutdown_finishes_calls.cc b/test/core/end2end/tests/shutdown_finishes_calls.cc index 63f66a720cb..9c0e5d563ea 100644 --- a/test/core/end2end/tests/shutdown_finishes_calls.cc +++ b/test/core/end2end/tests/shutdown_finishes_calls.cc @@ -68,8 +68,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - /* f->shutdown_cq is not used in this test */ - grpc_completion_queue_destroy(f->shutdown_cq); } static void test_early_server_shutdown_finishes_inflight_calls( diff --git a/test/core/end2end/tests/shutdown_finishes_tags.cc b/test/core/end2end/tests/shutdown_finishes_tags.cc index 4c4128ef177..dd4cb94c253 100644 --- a/test/core/end2end/tests/shutdown_finishes_tags.cc +++ b/test/core/end2end/tests/shutdown_finishes_tags.cc @@ -68,8 +68,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - /* f->shutdown_cq is not used in this test */ - grpc_completion_queue_destroy(f->shutdown_cq); } static void test_early_server_shutdown_finishes_tags( diff --git a/test/core/end2end/tests/simple_delayed_request.cc b/test/core/end2end/tests/simple_delayed_request.cc index 101701223ce..79f2cc3af32 100644 --- a/test/core/end2end/tests/simple_delayed_request.cc +++ b/test/core/end2end/tests/simple_delayed_request.cc @@ -46,11 +46,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -68,7 +69,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } static void simple_delayed_request_body(grpc_end2end_test_config config, diff --git a/test/core/end2end/tests/simple_metadata.cc b/test/core/end2end/tests/simple_metadata.cc index 74c28d4ff7b..53e430c7756 100644 --- a/test/core/end2end/tests/simple_metadata.cc +++ b/test/core/end2end/tests/simple_metadata.cc @@ -58,11 +58,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -80,7 +81,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Request/response with metadata and payload.*/ diff --git a/test/core/end2end/tests/simple_request.cc b/test/core/end2end/tests/simple_request.cc index 3a0b75f5179..593cdae0298 100644 --- a/test/core/end2end/tests/simple_request.cc +++ b/test/core/end2end/tests/simple_request.cc @@ -63,11 +63,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -85,7 +86,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } static void check_peer(char* peer_name) { diff --git a/test/core/end2end/tests/streaming_error_response.cc b/test/core/end2end/tests/streaming_error_response.cc index 178eb68fb24..f2634af52fc 100644 --- a/test/core/end2end/tests/streaming_error_response.cc +++ b/test/core/end2end/tests/streaming_error_response.cc @@ -63,11 +63,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -85,7 +86,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } // Client sends a request with payload, potentially requesting status early. The diff --git a/test/core/end2end/tests/trailing_metadata.cc b/test/core/end2end/tests/trailing_metadata.cc index 1d1b883e9fe..ee4e72090f1 100644 --- a/test/core/end2end/tests/trailing_metadata.cc +++ b/test/core/end2end/tests/trailing_metadata.cc @@ -58,11 +58,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -80,7 +81,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(f->cq); grpc_completion_queue_destroy(f->cq); - grpc_completion_queue_destroy(f->shutdown_cq); } /* Request/response with metadata and payload.*/ diff --git a/test/core/end2end/tests/write_buffering.cc b/test/core/end2end/tests/write_buffering.cc index d3536a91f5f..9697d572d71 100644 --- a/test/core/end2end/tests/write_buffering.cc +++ b/test/core/end2end/tests/write_buffering.cc @@ -58,11 +58,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -80,7 +81,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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. */ diff --git a/test/core/end2end/tests/write_buffering_at_end.cc b/test/core/end2end/tests/write_buffering_at_end.cc index c0114d9bf70..cc2ba02f011 100644 --- a/test/core/end2end/tests/write_buffering_at_end.cc +++ b/test/core/end2end/tests/write_buffering_at_end.cc @@ -58,11 +58,12 @@ static void drain_cq(grpc_completion_queue* cq) { static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), - nullptr) - .type == GRPC_OP_COMPLETE); + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + grpc_event ev; + do { + ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5), + nullptr); + } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000)); grpc_server_destroy(f->server); f->server = nullptr; } @@ -80,7 +81,6 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_shutdown(f->cq); drain_cq(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. */