From: Ben Darnell Date: Mon, 30 Dec 2013 01:41:17 +0000 (-0500) Subject: Disallow ipv6 in curl-based tests. X-Git-Tag: v3.2.0b1~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a48831ca8cdccb0a0e1a309c77adc8f388189a3c;p=thirdparty%2Ftornado.git Disallow ipv6 in curl-based tests. The test servers only listen on ipv4, and it appears that libcurl 7.19.34 has regressed in its ability to handle the case when localhost resolves to both v4 and v6 variants but only one works. IPv6 was already disabled by default in simple_httpclient tests. --- diff --git a/tornado/test/curl_httpclient_test.py b/tornado/test/curl_httpclient_test.py index faf6cdc79..fb6965648 100644 --- a/tornado/test/curl_httpclient_test.py +++ b/tornado/test/curl_httpclient_test.py @@ -22,7 +22,8 @@ if pycurl is not None: @unittest.skipIf(pycurl is None, "pycurl module not present") class CurlHTTPClientCommonTestCase(httpclient_test.HTTPClientCommonTestCase): def get_http_client(self): - client = CurlAsyncHTTPClient(io_loop=self.io_loop) + client = CurlAsyncHTTPClient(io_loop=self.io_loop, + defaults=dict(allow_ipv6=False)) # make sure AsyncHTTPClient magic doesn't give us the wrong class self.assertTrue(isinstance(client, CurlAsyncHTTPClient)) return client @@ -71,7 +72,8 @@ class DigestAuthHandler(RequestHandler): class CurlHTTPClientTestCase(AsyncHTTPTestCase): def setUp(self): super(CurlHTTPClientTestCase, self).setUp() - self.http_client = CurlAsyncHTTPClient(self.io_loop) + self.http_client = CurlAsyncHTTPClient(self.io_loop, + defaults=dict(allow_ipv6=False)) def get_app(self): return Application([ diff --git a/tornado/test/httpclient_test.py b/tornado/test/httpclient_test.py index 0ebdd8ddc..569ea872e 100644 --- a/tornado/test/httpclient_test.py +++ b/tornado/test/httpclient_test.py @@ -310,7 +310,7 @@ Transfer-Encoding: chunked self.assertIs(exc_info[0][0], ZeroDivisionError) def test_configure_defaults(self): - defaults = dict(user_agent='TestDefaultUserAgent') + defaults = dict(user_agent='TestDefaultUserAgent', allow_ipv6=False) # Construct a new instance of the configured client class client = self.http_client.__class__(self.io_loop, force_instance=True, defaults=defaults) diff --git a/tornado/test/runtests.py b/tornado/test/runtests.py index 786bbf983..37efc2050 100644 --- a/tornado/test/runtests.py +++ b/tornado/test/runtests.py @@ -91,7 +91,8 @@ if __name__ == '__main__': logging.getLogger("tornado.access").setLevel(logging.CRITICAL) define('httpclient', type=str, default=None, - callback=AsyncHTTPClient.configure) + callback=lambda s: AsyncHTTPClient.configure( + s, defaults=dict(allow_ipv6=False))) define('ioloop', type=str, default=None) define('ioloop_time_monotonic', default=False) define('resolver', type=str, default=None,