From f525768167acf198b120a59ce9ac2f286a1677cb Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Thu, 11 Jul 2024 15:21:09 -0400 Subject: [PATCH] test: Remove skipOnTravis We haven't used Travis for CI in a long time, and our current CI system is much less overloaded so these timing-sensitive tests are no longer flaky. --- tornado/test/gen_test.py | 3 +-- tornado/test/httpclient_test.py | 3 +-- tornado/test/httpserver_test.py | 3 +-- tornado/test/ioloop_test.py | 3 --- tornado/test/netutil_test.py | 2 -- tornado/test/simple_httpclient_test.py | 3 --- tornado/test/tcpclient_test.py | 2 -- tornado/test/util.py | 8 +------- 8 files changed, 4 insertions(+), 23 deletions(-) diff --git a/tornado/test/gen_test.py b/tornado/test/gen_test.py index 87f6ab7f..1a365dbd 100644 --- a/tornado/test/gen_test.py +++ b/tornado/test/gen_test.py @@ -11,7 +11,7 @@ import unittest from tornado.concurrent import Future from tornado.log import app_log from tornado.testing import AsyncHTTPTestCase, AsyncTestCase, ExpectLog, gen_test -from tornado.test.util import skipOnTravis, skipNotCPython +from tornado.test.util import skipNotCPython from tornado.web import Application, RequestHandler, HTTPError from tornado import gen @@ -139,7 +139,6 @@ class GenBasicTest(AsyncTestCase): self.io_loop.run_sync(f) - @skipOnTravis @gen_test def test_multi_performance(self): # Yielding a list used to have quadratic performance; make diff --git a/tornado/test/httpclient_test.py b/tornado/test/httpclient_test.py index 40a29d0b..f6e7dbbe 100644 --- a/tornado/test/httpclient_test.py +++ b/tornado/test/httpclient_test.py @@ -28,7 +28,7 @@ from tornado.iostream import IOStream from tornado.log import gen_log, app_log from tornado import netutil from tornado.testing import AsyncHTTPTestCase, bind_unused_port, gen_test, ExpectLog -from tornado.test.util import skipOnTravis, ignore_deprecation +from tornado.test.util import ignore_deprecation from tornado.web import Application, RequestHandler, url from tornado.httputil import format_timestamp, HTTPHeaders @@ -191,7 +191,6 @@ class HTTPClientCommonTestCase(AsyncHTTPTestCase): self.assertEqual(response.code, 200) self.assertEqual(response.body, body) - @skipOnTravis def test_hello_world(self): response = self.fetch("/hello") self.assertEqual(response.code, 200) diff --git a/tornado/test/httpserver_test.py b/tornado/test/httpserver_test.py index 3a90440d..7b411ed6 100644 --- a/tornado/test/httpserver_test.py +++ b/tornado/test/httpserver_test.py @@ -27,7 +27,7 @@ from tornado.testing import ( ExpectLog, gen_test, ) -from tornado.test.util import skipOnTravis, abstract_base_test +from tornado.test.util import abstract_base_test from tornado.web import Application, RequestHandler, stream_request_body from contextlib import closing @@ -1267,7 +1267,6 @@ class MaxHeaderSizeTest(AsyncHTTPTestCase): self.assertIn(e.response.code, (431, 599)) -@skipOnTravis class IdleTimeoutTest(AsyncHTTPTestCase): def get_app(self): return Application([("/", HelloWorldRequestHandler)]) diff --git a/tornado/test/ioloop_test.py b/tornado/test/ioloop_test.py index 21239392..047b3614 100644 --- a/tornado/test/ioloop_test.py +++ b/tornado/test/ioloop_test.py @@ -28,7 +28,6 @@ from tornado.testing import ( from tornado.test.util import ( ignore_deprecation, skipIfNonUnix, - skipOnTravis, ) from tornado.concurrent import Future @@ -58,7 +57,6 @@ class TestIOLoop(AsyncTestCase): loop.start() self.assertLess(self.calls, 10) - @skipOnTravis def test_add_callback_wakeup(self): # Make sure that add_callback from inside a running IOLoop # wakes up the IOLoop immediately instead of waiting for a timeout. @@ -77,7 +75,6 @@ class TestIOLoop(AsyncTestCase): self.assertAlmostEqual(time.time(), self.start_time, places=2) self.assertTrue(self.called) - @skipOnTravis def test_add_callback_wakeup_other_thread(self): def target(): # sleep a bit to let the ioloop go into its poll loop diff --git a/tornado/test/netutil_test.py b/tornado/test/netutil_test.py index ef82cba8..23347278 100644 --- a/tornado/test/netutil_test.py +++ b/tornado/test/netutil_test.py @@ -188,8 +188,6 @@ class IsValidIPTest(unittest.TestCase): class TestPortAllocation(unittest.TestCase): def test_same_port_allocation(self): - if "TRAVIS" in os.environ: - self.skipTest("dual-stack servers often have port conflicts on travis") sockets = bind_sockets(0, "localhost") try: port = sockets[0].getsockname()[1] diff --git a/tornado/test/simple_httpclient_test.py b/tornado/test/simple_httpclient_test.py index 07f04ae9..c1cff83c 100644 --- a/tornado/test/simple_httpclient_test.py +++ b/tornado/test/simple_httpclient_test.py @@ -41,7 +41,6 @@ from tornado.testing import ( ) from tornado.test.util import ( abstract_base_test, - skipOnTravis, skipIfNoIPv6, refusing_port, ) @@ -288,7 +287,6 @@ class SimpleHTTPClientTestMixin(AsyncTestCase): # request is the original request, is a POST still self.assertEqual("POST", response.request.method) - @skipOnTravis @gen_test def test_connect_timeout(self): timeout = 0.1 @@ -317,7 +315,6 @@ class SimpleHTTPClientTestMixin(AsyncTestCase): cleanup_event.set() yield gen.sleep(0.2) - @skipOnTravis def test_request_timeout(self): timeout = 0.1 if os.name == "nt": diff --git a/tornado/test/tcpclient_test.py b/tornado/test/tcpclient_test.py index 1636a649..73b383cb 100644 --- a/tornado/test/tcpclient_test.py +++ b/tornado/test/tcpclient_test.py @@ -64,8 +64,6 @@ class TCPClientTest(AsyncTestCase): self.client = TCPClient() def start_server(self, family): - if family == socket.AF_UNSPEC and "TRAVIS" in os.environ: - self.skipTest("dual-stack servers often have port conflicts on travis") self.server = TestTCPServer(family) return self.server.port diff --git a/tornado/test/util.py b/tornado/test/util.py index 40ff9d65..2e8bc3e5 100644 --- a/tornado/test/util.py +++ b/tornado/test/util.py @@ -16,12 +16,6 @@ skipIfNonUnix = unittest.skipIf( os.name != "posix" or sys.platform == "cygwin", "non-unix platform" ) -# travis-ci.org runs our tests in an overworked virtual machine, which makes -# timing-related tests unreliable. -skipOnTravis = unittest.skipIf( - "TRAVIS" in os.environ, "timing tests unreliable on travis" -) - # Set the environment variable NO_NETWORK=1 to disable any tests that # depend on an external network. skipIfNoNetwork = unittest.skipIf("NO_NETWORK" in os.environ, "network access disabled") @@ -67,7 +61,7 @@ def refusing_port(): Return value is (cleanup_func, port); the cleanup function must be called to free the port to be reused. """ - # On travis-ci, port numbers are reassigned frequently. To avoid + # On travis-ci port numbers are reassigned frequently. To avoid # collisions with other tests, we use an open client-side socket's # ephemeral port number to ensure that nothing can listen on that # port. -- 2.47.2