]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Just skip all timing-sensitive tests on travis-ci.
authorBen Darnell <ben@bendarnell.com>
Sun, 10 Mar 2013 23:11:59 +0000 (19:11 -0400)
committerBen Darnell <ben@bendarnell.com>
Sun, 10 Mar 2013 23:11:59 +0000 (19:11 -0400)
tornado/test/gen_test.py
tornado/test/ioloop_test.py
tornado/test/simple_httpclient_test.py
tornado/test/util.py

index 7c0fecb12c8d8bce7eaae1b3b0e70bbb45230ffd..5da8cfcff54c1b7611b04e0e5d57a4f30f780258 100644 (file)
@@ -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
index 76b7a24da1715879379b0bc46fdf25c395ffd913..4986637e0db6e9387806daa61e24d7f0d2167b35 100644 (file)
@@ -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
index 65fde6d5734789fcf5ed75f8c7fe6dac20abcd59..8f028e2401a8988dceab391b00e4f26b1e76170e 100644 (file)
@@ -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)
index 8d76343cac8238cb17979e8eaabdae2fa21ccbc2..36043104030b0b4cbe0fbd6b2846dd870e8e71fe 100644 (file)
@@ -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')