aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-05-11 10:55:02 -0700
committerGravatar GitHub <noreply@github.com>2017-05-11 10:55:02 -0700
commit63cde40c6dc031dcb358b7058fe3805284a6ad16 (patch)
treef55a352f0cb5356d1c5de3e12071ac182b135e0e /test/core
parent6d06776a126d90437361dcb295758a717d4b866d (diff)
parent822aae53d37bd569780b88bae5caa1fa2a5987ca (diff)
Merge pull request #11010 from ctiller/uberpoll
Roll up of all new polling engines
Diffstat (limited to 'test/core')
-rw-r--r--test/core/end2end/fixtures/http_proxy_fixture.c2
-rw-r--r--test/core/end2end/fuzzers/api_fuzzer.c4
-rw-r--r--test/core/end2end/tests/cancel_after_invoke.c12
-rw-r--r--test/core/http/httpcli_test.c2
-rw-r--r--test/core/http/httpscli_test.c2
-rw-r--r--test/core/iomgr/BUILD4
-rw-r--r--test/core/iomgr/endpoint_pair_test.c2
-rw-r--r--test/core/iomgr/ev_epollsig_linux_test.c (renamed from test/core/iomgr/ev_epoll_linux_test.c)9
-rw-r--r--test/core/iomgr/fd_conservation_posix_test.c1
-rw-r--r--test/core/iomgr/fd_posix_test.c3
-rw-r--r--test/core/iomgr/pollset_set_test.c7
-rw-r--r--test/core/iomgr/resolve_address_posix_test.c3
-rw-r--r--test/core/iomgr/resolve_address_test.c3
-rw-r--r--test/core/iomgr/tcp_client_posix_test.c2
-rw-r--r--test/core/iomgr/tcp_client_uv_test.c2
-rw-r--r--test/core/iomgr/tcp_posix_test.c2
-rw-r--r--test/core/iomgr/tcp_server_posix_test.c2
-rw-r--r--test/core/iomgr/tcp_server_uv_test.c2
-rw-r--r--test/core/iomgr/timer_list_test.c13
-rw-r--r--test/core/iomgr/udp_server_test.c2
-rw-r--r--test/core/security/secure_endpoint_test.c2
-rw-r--r--test/core/surface/concurrent_connectivity_test.c2
-rw-r--r--test/core/transport/connectivity_state_test.c2
-rw-r--r--test/core/util/port_server_client.c8
-rw-r--r--test/core/util/test_tcp_server.c9
25 files changed, 60 insertions, 42 deletions
diff --git a/test/core/end2end/fixtures/http_proxy_fixture.c b/test/core/end2end/fixtures/http_proxy_fixture.c
index 5df43b9384..c2d8480e69 100644
--- a/test/core/end2end/fixtures/http_proxy_fixture.c
+++ b/test/core/end2end/fixtures/http_proxy_fixture.c
@@ -489,7 +489,7 @@ grpc_end2end_http_proxy* grpc_end2end_http_proxy_create(void) {
static void destroy_pollset(grpc_exec_ctx* exec_ctx, void* arg,
grpc_error* error) {
grpc_pollset* pollset = (grpc_pollset*)arg;
- grpc_pollset_destroy(pollset);
+ grpc_pollset_destroy(exec_ctx, pollset);
gpr_free(pollset);
}
diff --git a/test/core/end2end/fuzzers/api_fuzzer.c b/test/core/end2end/fuzzers/api_fuzzer.c
index 88a0e301da..b33b43dac5 100644
--- a/test/core/end2end/fuzzers/api_fuzzer.c
+++ b/test/core/end2end/fuzzers/api_fuzzer.c
@@ -44,6 +44,7 @@
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/tcp_client.h"
#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/iomgr/timer_manager.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/server.h"
#include "src/core/lib/transport/metadata.h"
@@ -722,6 +723,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
grpc_tcp_client_connect_impl = my_tcp_client_connect;
gpr_now_impl = now_impl;
grpc_init();
+ grpc_timer_manager_set_threading(false);
grpc_resolve_address = my_resolve_address;
GPR_ASSERT(g_channel == NULL);
@@ -769,6 +771,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
g_now = gpr_time_add(g_now, gpr_time_from_seconds(1, GPR_TIMESPAN));
}
+ grpc_timer_manager_tick();
+
switch (next_byte(&inp)) {
// terminate on bad bytes
default:
diff --git a/test/core/end2end/tests/cancel_after_invoke.c b/test/core/end2end/tests/cancel_after_invoke.c
index 5bc9ed283b..6deb86ea3e 100644
--- a/test/core/end2end/tests/cancel_after_invoke.c
+++ b/test/core/end2end/tests/cancel_after_invoke.c
@@ -147,6 +147,11 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config,
op->flags = 0;
op->reserved = NULL;
op++;
+ op->op = GRPC_OP_RECV_INITIAL_METADATA;
+ op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+ op->flags = 0;
+ op->reserved = NULL;
+ op++;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
op->data.send_initial_metadata.count = 0;
op->flags = 0;
@@ -161,11 +166,6 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config,
op->flags = 0;
op->reserved = NULL;
op++;
- op->op = GRPC_OP_RECV_INITIAL_METADATA;
- op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
- op->flags = 0;
- op->reserved = NULL;
- op++;
op->op = GRPC_OP_RECV_MESSAGE;
op->data.recv_message.recv_message = &response_payload_recv;
op->flags = 0;
@@ -200,7 +200,7 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config,
void cancel_after_invoke(grpc_end2end_test_config config) {
unsigned i, j;
- for (j = 2; j < 6; j++) {
+ for (j = 3; j < 6; j++) {
for (i = 0; i < GPR_ARRAY_SIZE(cancellation_modes); i++) {
test_cancel_after_invoke(config, cancellation_modes[i], j);
}
diff --git a/test/core/http/httpcli_test.c b/test/core/http/httpcli_test.c
index d3b45c4505..21135ddf6b 100644
--- a/test/core/http/httpcli_test.c
+++ b/test/core/http/httpcli_test.c
@@ -155,7 +155,7 @@ static void test_post(int port) {
}
static void destroy_pops(grpc_exec_ctx *exec_ctx, void *p, grpc_error *error) {
- grpc_pollset_destroy(grpc_polling_entity_pollset(p));
+ grpc_pollset_destroy(exec_ctx, grpc_polling_entity_pollset(p));
}
int main(int argc, char **argv) {
diff --git a/test/core/http/httpscli_test.c b/test/core/http/httpscli_test.c
index acc94091f4..73eaae87d7 100644
--- a/test/core/http/httpscli_test.c
+++ b/test/core/http/httpscli_test.c
@@ -157,7 +157,7 @@ static void test_post(int port) {
}
static void destroy_pops(grpc_exec_ctx *exec_ctx, void *p, grpc_error *error) {
- grpc_pollset_destroy(grpc_polling_entity_pollset(p));
+ grpc_pollset_destroy(exec_ctx, grpc_polling_entity_pollset(p));
}
int main(int argc, char **argv) {
diff --git a/test/core/iomgr/BUILD b/test/core/iomgr/BUILD
index 0cf93e73f5..808faf57c9 100644
--- a/test/core/iomgr/BUILD
+++ b/test/core/iomgr/BUILD
@@ -55,8 +55,8 @@ cc_test(
)
cc_test(
- name = "ev_epoll_linux_test",
- srcs = ["ev_epoll_linux_test.c"],
+ name = "ev_epollsig_linux_test",
+ srcs = ["ev_epollsig_linux_test.c"],
deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
copts = ['-std=c99']
)
diff --git a/test/core/iomgr/endpoint_pair_test.c b/test/core/iomgr/endpoint_pair_test.c
index c8a60776b9..4561c3846e 100644
--- a/test/core/iomgr/endpoint_pair_test.c
+++ b/test/core/iomgr/endpoint_pair_test.c
@@ -70,7 +70,7 @@ static grpc_endpoint_test_config configs[] = {
static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p,
grpc_error *error) {
- grpc_pollset_destroy(p);
+ grpc_pollset_destroy(exec_ctx, p);
}
int main(int argc, char **argv) {
diff --git a/test/core/iomgr/ev_epoll_linux_test.c b/test/core/iomgr/ev_epollsig_linux_test.c
index 0856023b14..45c542de4e 100644
--- a/test/core/iomgr/ev_epoll_linux_test.c
+++ b/test/core/iomgr/ev_epollsig_linux_test.c
@@ -34,7 +34,7 @@
/* This test only relevant on linux systems where epoll() is available */
#ifdef GRPC_LINUX_EPOLL
-#include "src/core/lib/iomgr/ev_epoll_linux.h"
+#include "src/core/lib/iomgr/ev_epollsig_linux.h"
#include "src/core/lib/iomgr/ev_posix.h"
#include <errno.h>
@@ -113,7 +113,7 @@ static void test_pollset_init(test_pollset *pollsets, int num_pollsets) {
static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p,
grpc_error *error) {
- grpc_pollset_destroy(p);
+ grpc_pollset_destroy(exec_ctx, p);
}
static void test_pollset_cleanup(grpc_exec_ctx *exec_ctx,
@@ -403,15 +403,16 @@ int main(int argc, char **argv) {
const char *poll_strategy = NULL;
grpc_test_init(argc, argv);
grpc_iomgr_init();
+ grpc_iomgr_start();
poll_strategy = grpc_get_poll_strategy_name();
- if (poll_strategy != NULL && strcmp(poll_strategy, "epoll") == 0) {
+ if (poll_strategy != NULL && strcmp(poll_strategy, "epollsig") == 0) {
test_add_fd_to_pollset();
test_pollset_queue_merge_items();
test_threading();
} else {
gpr_log(GPR_INFO,
- "Skipping the test. The test is only relevant for 'epoll' "
+ "Skipping the test. The test is only relevant for 'epollsig' "
"strategy. and the current strategy is: '%s'",
poll_strategy);
}
diff --git a/test/core/iomgr/fd_conservation_posix_test.c b/test/core/iomgr/fd_conservation_posix_test.c
index 6ac322bb01..f662070655 100644
--- a/test/core/iomgr/fd_conservation_posix_test.c
+++ b/test/core/iomgr/fd_conservation_posix_test.c
@@ -46,6 +46,7 @@ int main(int argc, char **argv) {
grpc_test_init(argc, argv);
grpc_iomgr_init();
+ grpc_iomgr_start();
/* set max # of file descriptors to a low value, and
verify we can create and destroy many more than this number
diff --git a/test/core/iomgr/fd_posix_test.c b/test/core/iomgr/fd_posix_test.c
index 81d2692a08..9e8fe8bffa 100644
--- a/test/core/iomgr/fd_posix_test.c
+++ b/test/core/iomgr/fd_posix_test.c
@@ -535,7 +535,7 @@ static void test_grpc_fd_change(void) {
static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p,
grpc_error *error) {
- grpc_pollset_destroy(p);
+ grpc_pollset_destroy(exec_ctx, p);
}
int main(int argc, char **argv) {
@@ -543,6 +543,7 @@ int main(int argc, char **argv) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_test_init(argc, argv);
grpc_iomgr_init();
+ grpc_iomgr_start();
g_pollset = gpr_zalloc(grpc_pollset_size());
grpc_pollset_init(g_pollset, &g_mu);
test_grpc_fd();
diff --git a/test/core/iomgr/pollset_set_test.c b/test/core/iomgr/pollset_set_test.c
index 3a9d459579..092711381d 100644
--- a/test/core/iomgr/pollset_set_test.c
+++ b/test/core/iomgr/pollset_set_test.c
@@ -86,7 +86,7 @@ static void init_test_pollsets(test_pollset *pollsets, const int num_pollsets) {
static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p,
grpc_error *error) {
- grpc_pollset_destroy(p);
+ grpc_pollset_destroy(exec_ctx, p);
}
static void cleanup_test_pollsets(grpc_exec_ctx *exec_ctx,
@@ -448,8 +448,11 @@ int main(int argc, char **argv) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_test_init(argc, argv);
grpc_iomgr_init();
+ grpc_iomgr_start();
- if (poll_strategy != NULL && strcmp(poll_strategy, "epoll") == 0) {
+ if (poll_strategy != NULL &&
+ (strcmp(poll_strategy, "epoll") == 0 ||
+ strcmp(poll_strategy, "epoll-threadpool") == 0)) {
pollset_set_test_basic();
pollset_set_test_dup_fds();
pollset_set_test_empty_pollset();
diff --git a/test/core/iomgr/resolve_address_posix_test.c b/test/core/iomgr/resolve_address_posix_test.c
index fa88aca431..bee7036ec8 100644
--- a/test/core/iomgr/resolve_address_posix_test.c
+++ b/test/core/iomgr/resolve_address_posix_test.c
@@ -81,7 +81,7 @@ void args_finish(grpc_exec_ctx *exec_ctx, args_struct *args) {
grpc_pollset_shutdown(exec_ctx, args->pollset, &do_nothing_cb);
// exec_ctx needs to be flushed before calling grpc_pollset_destroy()
grpc_exec_ctx_flush(exec_ctx);
- grpc_pollset_destroy(args->pollset);
+ grpc_pollset_destroy(exec_ctx, args->pollset);
gpr_free(args->pollset);
}
@@ -176,6 +176,7 @@ int main(int argc, char **argv) {
grpc_test_init(argc, argv);
grpc_executor_init();
grpc_iomgr_init();
+ grpc_iomgr_start();
test_unix_socket();
test_unix_socket_path_name_too_long();
{
diff --git a/test/core/iomgr/resolve_address_test.c b/test/core/iomgr/resolve_address_test.c
index ea79adc090..83f73070dc 100644
--- a/test/core/iomgr/resolve_address_test.c
+++ b/test/core/iomgr/resolve_address_test.c
@@ -76,7 +76,7 @@ void args_finish(grpc_exec_ctx *exec_ctx, args_struct *args) {
grpc_pollset_shutdown(exec_ctx, args->pollset, &do_nothing_cb);
// exec_ctx needs to be flushed before calling grpc_pollset_destroy()
grpc_exec_ctx_flush(exec_ctx);
- grpc_pollset_destroy(args->pollset);
+ grpc_pollset_destroy(exec_ctx, args->pollset);
gpr_free(args->pollset);
}
@@ -265,6 +265,7 @@ int main(int argc, char **argv) {
grpc_test_init(argc, argv);
grpc_executor_init();
grpc_iomgr_init();
+ grpc_iomgr_start();
test_localhost();
test_default_port();
test_non_numeric_default_port();
diff --git a/test/core/iomgr/tcp_client_posix_test.c b/test/core/iomgr/tcp_client_posix_test.c
index 2fae6774e8..6e1bb43eb5 100644
--- a/test/core/iomgr/tcp_client_posix_test.c
+++ b/test/core/iomgr/tcp_client_posix_test.c
@@ -197,7 +197,7 @@ void test_fails(void) {
static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p,
grpc_error *error) {
- grpc_pollset_destroy(p);
+ grpc_pollset_destroy(exec_ctx, p);
}
int main(int argc, char **argv) {
diff --git a/test/core/iomgr/tcp_client_uv_test.c b/test/core/iomgr/tcp_client_uv_test.c
index 92fc393422..3a8458df86 100644
--- a/test/core/iomgr/tcp_client_uv_test.c
+++ b/test/core/iomgr/tcp_client_uv_test.c
@@ -194,7 +194,7 @@ void test_fails(void) {
static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p,
grpc_error *error) {
- grpc_pollset_destroy(p);
+ grpc_pollset_destroy(exec_ctx, p);
}
int main(int argc, char **argv) {
diff --git a/test/core/iomgr/tcp_posix_test.c b/test/core/iomgr/tcp_posix_test.c
index 2c53a003d2..a1c54e19c1 100644
--- a/test/core/iomgr/tcp_posix_test.c
+++ b/test/core/iomgr/tcp_posix_test.c
@@ -562,7 +562,7 @@ static grpc_endpoint_test_config configs[] = {
static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p,
grpc_error *error) {
- grpc_pollset_destroy(p);
+ grpc_pollset_destroy(exec_ctx, p);
}
int main(int argc, char **argv) {
diff --git a/test/core/iomgr/tcp_server_posix_test.c b/test/core/iomgr/tcp_server_posix_test.c
index 112743b95b..88aead1dd0 100644
--- a/test/core/iomgr/tcp_server_posix_test.c
+++ b/test/core/iomgr/tcp_server_posix_test.c
@@ -444,7 +444,7 @@ static void test_connect(size_t num_connects,
static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p,
grpc_error *error) {
- grpc_pollset_destroy(p);
+ grpc_pollset_destroy(exec_ctx, p);
}
int main(int argc, char **argv) {
diff --git a/test/core/iomgr/tcp_server_uv_test.c b/test/core/iomgr/tcp_server_uv_test.c
index 1e039585c1..945b84a355 100644
--- a/test/core/iomgr/tcp_server_uv_test.c
+++ b/test/core/iomgr/tcp_server_uv_test.c
@@ -306,7 +306,7 @@ static void test_connect(unsigned n) {
static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p,
grpc_error *error) {
- grpc_pollset_destroy(p);
+ grpc_pollset_destroy(exec_ctx, p);
}
int main(int argc, char **argv) {
diff --git a/test/core/iomgr/timer_list_test.c b/test/core/iomgr/timer_list_test.c
index 46e41dd449..88a9f6b855 100644
--- a/test/core/iomgr/timer_list_test.c
+++ b/test/core/iomgr/timer_list_test.c
@@ -41,12 +41,13 @@
#include <string.h>
#include <grpc/support/log.h>
+#include "src/core/lib/debug/trace.h"
#include "test/core/util/test_config.h"
#define MAX_CB 30
-extern int grpc_timer_trace;
-extern int grpc_timer_check_trace;
+extern grpc_tracer_flag grpc_timer_trace;
+extern grpc_tracer_flag grpc_timer_check_trace;
static int cb_called[MAX_CB][2];
@@ -63,8 +64,8 @@ static void add_test(void) {
gpr_log(GPR_INFO, "add_test");
grpc_timer_list_init(start);
- grpc_timer_trace = 1;
- grpc_timer_check_trace = 1;
+ grpc_timer_trace.value = 1;
+ grpc_timer_check_trace.value = 1;
memset(cb_called, 0, sizeof(cb_called));
/* 10 ms timers. will expire in the current epoch */
@@ -138,8 +139,8 @@ void destruction_test(void) {
gpr_log(GPR_INFO, "destruction_test");
grpc_timer_list_init(gpr_time_0(GPR_CLOCK_REALTIME));
- grpc_timer_trace = 1;
- grpc_timer_check_trace = 1;
+ grpc_timer_trace.value = 1;
+ grpc_timer_check_trace.value = 1;
memset(cb_called, 0, sizeof(cb_called));
grpc_timer_init(
diff --git a/test/core/iomgr/udp_server_test.c b/test/core/iomgr/udp_server_test.c
index 1f1696a7a7..ee78d6b4ad 100644
--- a/test/core/iomgr/udp_server_test.c
+++ b/test/core/iomgr/udp_server_test.c
@@ -307,7 +307,7 @@ static void test_receive(int number_of_clients) {
static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p,
grpc_error *error) {
- grpc_pollset_destroy(p);
+ grpc_pollset_destroy(exec_ctx, p);
}
int main(int argc, char **argv) {
diff --git a/test/core/security/secure_endpoint_test.c b/test/core/security/secure_endpoint_test.c
index 71d8057ac3..cd6ff2ceac 100644
--- a/test/core/security/secure_endpoint_test.c
+++ b/test/core/security/secure_endpoint_test.c
@@ -185,7 +185,7 @@ static void test_leftover(grpc_endpoint_test_config config, size_t slice_size) {
static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p,
grpc_error *error) {
- grpc_pollset_destroy(p);
+ grpc_pollset_destroy(exec_ctx, p);
}
int main(int argc, char **argv) {
diff --git a/test/core/surface/concurrent_connectivity_test.c b/test/core/surface/concurrent_connectivity_test.c
index d6841ea1f8..f0e3394b2e 100644
--- a/test/core/surface/concurrent_connectivity_test.c
+++ b/test/core/surface/concurrent_connectivity_test.c
@@ -162,7 +162,7 @@ void bad_server_thread(void *vargs) {
static void done_pollset_shutdown(grpc_exec_ctx *exec_ctx, void *pollset,
grpc_error *error) {
- grpc_pollset_destroy(pollset);
+ grpc_pollset_destroy(exec_ctx, pollset);
gpr_free(pollset);
}
diff --git a/test/core/transport/connectivity_state_test.c b/test/core/transport/connectivity_state_test.c
index 8314a5f619..96db59ba2d 100644
--- a/test/core/transport/connectivity_state_test.c
+++ b/test/core/transport/connectivity_state_test.c
@@ -151,7 +151,7 @@ static void test_subscribe_with_failure_then_destroy(void) {
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
- grpc_connectivity_state_trace = 1;
+ grpc_connectivity_state_trace.value = 1;
test_connectivity_state_name();
test_check();
test_subscribe_then_unsubscribe();
diff --git a/test/core/util/port_server_client.c b/test/core/util/port_server_client.c
index 254c3a6b61..6ef0acfc29 100644
--- a/test/core/util/port_server_client.c
+++ b/test/core/util/port_server_client.c
@@ -58,9 +58,8 @@ typedef struct freereq {
static void destroy_pops_and_shutdown(grpc_exec_ctx *exec_ctx, void *p,
grpc_error *error) {
grpc_pollset *pollset = grpc_polling_entity_pollset(p);
- grpc_pollset_destroy(pollset);
+ grpc_pollset_destroy(exec_ctx, pollset);
gpr_free(pollset);
- grpc_shutdown();
}
static void freed_port_from_server(grpc_exec_ctx *exec_ctx, void *arg,
@@ -122,12 +121,13 @@ void grpc_free_port_using_server(int port) {
gpr_mu_unlock(pr.mu);
grpc_httpcli_context_destroy(&exec_ctx, &context);
- grpc_exec_ctx_finish(&exec_ctx);
grpc_pollset_shutdown(&exec_ctx, grpc_polling_entity_pollset(&pr.pops),
shutdown_closure);
grpc_exec_ctx_finish(&exec_ctx);
gpr_free(path);
grpc_http_response_destroy(&rsp);
+
+ grpc_shutdown();
}
typedef struct portreq {
@@ -239,7 +239,6 @@ int grpc_pick_port_using_server(void) {
grpc_closure_create(got_port_from_server, &pr, grpc_schedule_on_exec_ctx),
&pr.response);
grpc_resource_quota_unref_internal(&exec_ctx, resource_quota);
- grpc_exec_ctx_finish(&exec_ctx);
gpr_mu_lock(pr.mu);
while (pr.port == -1) {
grpc_pollset_worker *worker = NULL;
@@ -258,6 +257,7 @@ int grpc_pick_port_using_server(void) {
grpc_pollset_shutdown(&exec_ctx, grpc_polling_entity_pollset(&pr.pops),
shutdown_closure);
grpc_exec_ctx_finish(&exec_ctx);
+ grpc_shutdown();
return pr.port;
}
diff --git a/test/core/util/test_tcp_server.c b/test/core/util/test_tcp_server.c
index 496e579bc3..1908698009 100644
--- a/test/core/util/test_tcp_server.c
+++ b/test/core/util/test_tcp_server.c
@@ -106,6 +106,10 @@ void test_tcp_server_poll(test_tcp_server *server, int seconds) {
}
static void do_nothing(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {}
+static void finish_pollset(grpc_exec_ctx *exec_ctx, void *arg,
+ grpc_error *error) {
+ grpc_pollset_destroy(exec_ctx, arg);
+}
void test_tcp_server_destroy(test_tcp_server *server) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
@@ -120,9 +124,10 @@ void test_tcp_server_destroy(test_tcp_server *server) {
gpr_time_cmp(gpr_now(GPR_CLOCK_MONOTONIC), shutdown_deadline) < 0) {
test_tcp_server_poll(server, 1);
}
- grpc_pollset_shutdown(&exec_ctx, server->pollset, &do_nothing_cb);
+ grpc_pollset_shutdown(&exec_ctx, server->pollset,
+ grpc_closure_create(finish_pollset, server->pollset,
+ grpc_schedule_on_exec_ctx));
grpc_exec_ctx_finish(&exec_ctx);
- grpc_pollset_destroy(server->pollset);
gpr_free(server->pollset);
grpc_shutdown();
}