Skip to content

Commit

Permalink
Tweak a timing-sensitive test to have fewer false failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
bdarnell committed Apr 19, 2012
1 parent 38908bf commit 4e98959
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions tornado/test/testing_test.py
Expand Up @@ -20,10 +20,10 @@ def test_subsequent_wait_calls(self):
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):
Expand Down
2 changes: 1 addition & 1 deletion tornado/testing.py
Expand Up @@ -184,7 +184,7 @@ def wait(self, condition=None, timeout=5):
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()
Expand Down

0 comments on commit 4e98959

Please sign in to comment.