From e1b306ce07f4902400fa672b95eb2fdf0856567a Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Sat, 18 Oct 2014 12:08:03 -0400 Subject: [PATCH] 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. --- tornado/test/iostream_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- 2.47.2