From: Ben Darnell Date: Thu, 19 Apr 2012 01:32:59 +0000 (-0700) Subject: Tweak a timing-sensitive test to have fewer false failures. X-Git-Tag: v2.3.0~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e989593766fc2cbb4520e852bd8f419e4cf33fd;p=thirdparty%2Ftornado.git Tweak a timing-sensitive test to have fewer false failures. --- diff --git a/tornado/test/testing_test.py b/tornado/test/testing_test.py index e7d6a7392..b03018572 100644 --- a/tornado/test/testing_test.py +++ b/tornado/test/testing_test.py @@ -20,10 +20,10 @@ class AsyncTestCaseTest(AsyncTestCase, LogTrapTestCase): This test makes sure that a second call to wait() clears the first timeout. """ - self.io_loop.add_timeout(time.time() + 0.001, self.stop) - self.wait(timeout = 0.002) - self.io_loop.add_timeout(time.time() + 0.003, self.stop) - self.wait(timeout = 0.01) + self.io_loop.add_timeout(time.time() + 0.01, self.stop) + self.wait(timeout = 0.02) + self.io_loop.add_timeout(time.time() + 0.03, self.stop) + self.wait(timeout = 0.1) class SetUpTearDownTest(unittest.TestCase): def test_set_up_tear_down(self): diff --git a/tornado/testing.py b/tornado/testing.py index b06d149c1..5484e0ebd 100644 --- a/tornado/testing.py +++ b/tornado/testing.py @@ -184,7 +184,7 @@ class AsyncTestCase(unittest.TestCase): def timeout_func(): try: raise self.failureException( - 'Async operation timed out after %d seconds' % + 'Async operation timed out after %s seconds' % timeout) except Exception: self.__failure = sys.exc_info()