From: Ben Darnell Date: Tue, 12 Aug 2014 12:51:27 +0000 (-0400) Subject: Specify a non-zero port when testing localhost resolution. X-Git-Tag: v4.1.0b1~111 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afea02e18d4c228b7a5807df4c176e233580dc0f;p=thirdparty%2Ftornado.git Specify a non-zero port when testing localhost resolution. Some getaddrinfo implementations (including OS X 10.6) fail if we try to resolve port 0 without AI_PASSIVE. Closes #1136. --- diff --git a/tornado/test/tcpclient_test.py b/tornado/test/tcpclient_test.py index a9dfe5a5a..5df4a7abb 100644 --- a/tornado/test/tcpclient_test.py +++ b/tornado/test/tcpclient_test.py @@ -72,7 +72,9 @@ class TCPClientTest(AsyncTestCase): super(TCPClientTest, self).tearDown() def skipIfLocalhostV4(self): - Resolver().resolve('localhost', 0, callback=self.stop) + # The port used here doesn't matter, but some systems require it + # to be non-zero if we do not also pass AI_PASSIVE. + Resolver().resolve('localhost', 80, callback=self.stop) addrinfo = self.wait() families = set(addr[0] for addr in addrinfo) if socket.AF_INET6 not in families: