aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core
diff options
context:
space:
mode:
authorGravatar David Klempner <klempner@google.com>2016-05-13 15:24:17 -0700
committerGravatar David Klempner <klempner@google.com>2016-05-13 15:24:17 -0700
commit6fb122dc6e6245963534432c93418aadecd2e72f (patch)
tree3fbcc98a9042444b12420ab6b416cacb2bd6eaf4 /test/core
parentc7614cf2779c4909d8ec3f64923242cfd02f157a (diff)
Add calls to grpc_recycle_unused_port to two of the tests which call
grpc_pick_unused_port a lot.
Diffstat (limited to 'test/core')
-rw-r--r--test/core/end2end/dualstack_socket_test.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/core/end2end/dualstack_socket_test.c b/test/core/end2end/dualstack_socket_test.c
index 81f76ea79c..202fb3b6a8 100644
--- a/test/core/end2end/dualstack_socket_test.c
+++ b/test/core/end2end/dualstack_socket_test.c
@@ -88,9 +88,11 @@ void test_connect(const char *server_host, const char *client_host, int port,
int was_cancelled = 2;
grpc_call_details call_details;
char *peer;
+ int picked_port = 0;
if (port == 0) {
port = grpc_pick_unused_port_or_die();
+ picked_port = 1;
}
gpr_join_host_port(&server_hostport, server_host, port);
@@ -263,6 +265,9 @@ void test_connect(const char *server_host, const char *client_host, int port,
grpc_call_details_destroy(&call_details);
gpr_free(details);
+ if (picked_port) {
+ grpc_recycle_unused_port(port);
+ }
}
int external_dns_works(const char *host) {