From: Ben Darnell Date: Sat, 18 Oct 2014 16:08:03 +0000 (-0400) Subject: Change connection-refused test from localhost to 127.0.0.1. X-Git-Tag: v4.1.0b1~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1b306ce07f4902400fa672b95eb2fdf0856567a;p=thirdparty%2Ftornado.git Change connection-refused test from localhost to 127.0.0.1. This might be contributing to occasional timeouts on travis-ci (on the theory that some other test may be listening on the same port on ::1). Also explicitly stop the test if connect_callback is called. --- diff --git a/tornado/test/iostream_test.py b/tornado/test/iostream_test.py index b72661559..fa8590c83 100644 --- a/tornado/test/iostream_test.py +++ b/tornado/test/iostream_test.py @@ -224,10 +224,11 @@ class TestIOStreamMixin(object): def connect_callback(): self.connect_called = True + self.stop() stream.set_close_callback(self.stop) # log messages vary by platform and ioloop implementation with ExpectLog(gen_log, ".*", required=False): - stream.connect(("localhost", port), connect_callback) + stream.connect(("127.0.0.1", port), connect_callback) self.wait() self.assertFalse(self.connect_called) self.assertTrue(isinstance(stream.error, socket.error), stream.error)