From: Ben Darnell Date: Sun, 10 Mar 2013 23:11:59 +0000 (-0400) Subject: Just skip all timing-sensitive tests on travis-ci. X-Git-Tag: v3.0.0~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=abc5780a06a1edd0177a399a4dd4f39497cb0c57;p=thirdparty%2Ftornado.git Just skip all timing-sensitive tests on travis-ci. --- diff --git a/tornado/test/gen_test.py b/tornado/test/gen_test.py index 7c0fecb12..5da8cfcff 100644 --- a/tornado/test/gen_test.py +++ b/tornado/test/gen_test.py @@ -12,7 +12,7 @@ from tornado.httpclient import AsyncHTTPClient from tornado.log import app_log from tornado import stack_context from tornado.testing import AsyncHTTPTestCase, AsyncTestCase, ExpectLog, gen_test -from tornado.test.util import unittest +from tornado.test.util import unittest, skipOnTravis from tornado.web import Application, RequestHandler, asynchronous from tornado import gen @@ -250,6 +250,7 @@ class GenEngineTest(AsyncTestCase): self.stop() self.run_gen(f) + @skipOnTravis @gen_test def test_multi_performance(self): # Yielding a list used to have quadratic performance; make diff --git a/tornado/test/ioloop_test.py b/tornado/test/ioloop_test.py index 76b7a24da..4986637e0 100644 --- a/tornado/test/ioloop_test.py +++ b/tornado/test/ioloop_test.py @@ -14,7 +14,7 @@ from tornado import gen from tornado.ioloop import IOLoop, TimeoutError from tornado.stack_context import ExceptionStackContext, StackContext, wrap, NullContext from tornado.testing import AsyncTestCase, bind_unused_port -from tornado.test.util import unittest, skipIfNonUnix +from tornado.test.util import unittest, skipIfNonUnix, skipOnTravis try: from concurrent import futures @@ -23,6 +23,7 @@ except ImportError: class TestIOLoop(AsyncTestCase): + @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. @@ -40,6 +41,7 @@ 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/simple_httpclient_test.py b/tornado/test/simple_httpclient_test.py index 65fde6d57..8f028e240 100644 --- a/tornado/test/simple_httpclient_test.py +++ b/tornado/test/simple_httpclient_test.py @@ -18,7 +18,7 @@ from tornado.simple_httpclient import SimpleAsyncHTTPClient, _DEFAULT_CA_CERTS from tornado.test.httpclient_test import ChunkHandler, CountdownHandler, HelloWorldHandler from tornado.test import httpclient_test from tornado.testing import AsyncHTTPTestCase, AsyncTestCase, bind_unused_port, ExpectLog -from tornado.test.util import unittest +from tornado.test.util import unittest, skipOnTravis from tornado.web import RequestHandler, Application, asynchronous, url @@ -209,6 +209,7 @@ class SimpleHTTPClientTestCase(AsyncHTTPTestCase): # request is the original request, is a POST still self.assertEqual("POST", response.request.method) + @skipOnTravis def test_request_timeout(self): with ExpectLog(gen_log, "uncaught exception"): response = self.fetch('/trigger?wake=false', request_timeout=0.1) diff --git a/tornado/test/util.py b/tornado/test/util.py index 8d76343ca..360431040 100644 --- a/tornado/test/util.py +++ b/tornado/test/util.py @@ -12,3 +12,8 @@ else: 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')