aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/iomgr
diff options
context:
space:
mode:
authorGravatar Yang Gao <yangg@google.com>2017-04-14 15:39:02 -0700
committerGravatar GitHub <noreply@github.com>2017-04-14 15:39:02 -0700
commit52ff44f0d6e5af8428bc9a868593f20c954133dc (patch)
tree17d2f844219460363d15cf2710861661fbbc35d1 /test/core/iomgr
parent940b2bd06e90bc1acc0eb9ca3cdd3077ffd1f70c (diff)
parent2d38b05671ca0c6006c775ccb8cbb945118a794c (diff)
Merge pull request #10440 from danzh2010/udpserver
Modify udp_server to postpone shutdown_fd() during shutdown.
Diffstat (limited to 'test/core/iomgr')
-rw-r--r--test/core/iomgr/udp_server_test.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/core/iomgr/udp_server_test.c b/test/core/iomgr/udp_server_test.c
index 12d8406323..1f1696a7a7 100644
--- a/test/core/iomgr/udp_server_test.c
+++ b/test/core/iomgr/udp_server_test.c
@@ -91,7 +91,7 @@ static void on_write(grpc_exec_ctx *exec_ctx, grpc_fd *emfd, void *user_data) {
}
static void on_fd_orphaned(grpc_exec_ctx *exec_ctx, grpc_fd *emfd,
- void *user_data) {
+ grpc_closure *closure, void *user_data) {
gpr_log(GPR_INFO, "gRPC FD about to be orphaned: %d",
grpc_fd_wrapped_fd(emfd));
g_number_of_orphan_calls++;
@@ -228,9 +228,9 @@ static void test_no_op_with_port_and_start(void) {
grpc_udp_server_destroy(&exec_ctx, s, NULL);
grpc_exec_ctx_finish(&exec_ctx);
- /* The server had a single FD, which is orphaned once in *
- * deactivated_all_ports, and once in grpc_udp_server_destroy. */
- GPR_ASSERT(g_number_of_orphan_calls == 2);
+ /* The server had a single FD, which is orphaned exactly once in *
+ * grpc_udp_server_destroy. */
+ GPR_ASSERT(g_number_of_orphan_calls == 1);
}
static void test_receive(int number_of_clients) {
@@ -297,9 +297,9 @@ static void test_receive(int number_of_clients) {
grpc_udp_server_destroy(&exec_ctx, s, NULL);
grpc_exec_ctx_finish(&exec_ctx);
- /* The server had a single FD, which is orphaned once in *
- * deactivated_all_ports, and once in grpc_udp_server_destroy. */
- GPR_ASSERT(g_number_of_orphan_calls == 2);
+ /* The server had a single FD, which is orphaned exactly once in *
+ * grpc_udp_server_destroy. */
+ GPR_ASSERT(g_number_of_orphan_calls == 1);
/* The write callback should have fired a few times. */
GPR_ASSERT(g_number_of_writes > 0);