]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Change connection-refused test from localhost to 127.0.0.1.
authorBen Darnell <ben@bendarnell.com>
Sat, 18 Oct 2014 16:08:03 +0000 (12:08 -0400)
committerBen Darnell <ben@bendarnell.com>
Sat, 18 Oct 2014 16:11:10 +0000 (12:11 -0400)
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.

tornado/test/iostream_test.py

index b72661559cdce987010eeffe2be84702ca4c40ac..fa8590c8370bd4e1dc663f5ff6d7b2f082c3b41e 100644 (file)
@@ -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)