Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
tornado.testing AsyncTestCase.wait() (v2.2)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
bergundy  
View profile  
 More options Feb 8, 2:30 pm
From: bergundy <roey.ber...@gmail.com>
Date: Wed, 8 Feb 2012 11:30:11 -0800 (PST)
Local: Wed, Feb 8 2012 2:30 pm
Subject: tornado.testing AsyncTestCase.wait() (v2.2)
Consider the following test code:
----
from tornado.testing import AsyncTestCase
import time

class TestWait(AsyncTestCase):
    def test_1(self):
        self.io_loop.add_timeout(time.time() + 1, self.stop)
        self.wait(timeout = 2)
        self.io_loop.add_timeout(time.time() + 2, self.stop)
        self.wait(timeout = 5)
----

When calling wait() the second time, the first timeout is still set in
the ioloop which causes the test to fail with the following traceback:

-----
Traceback (most recent call last):
  File "/home/bergundy/test_wait.py", line 9, in test_1
    self.wait(timeout = 5)
  File "/netapp/dist/centos_5/i686/lib/python2.7/site-packages/tornado/
testing.py", line 169, in timeout_func
    timeout)
AssertionError: Async operation timed out after 2 seconds
-----

Is this intended behavior? Am I doing something wrong?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Darnell  
View profile  
 More options Feb 9, 12:30 am
From: Ben Darnell <b...@bendarnell.com>
Date: Wed, 8 Feb 2012 21:30:45 -0800
Local: Thurs, Feb 9 2012 12:30 am
Subject: Re: [tornado] tornado.testing AsyncTestCase.wait() (v2.2)
This is a bug.  The timeout feature was designed to catch runaway
tests that would otherwise run forever, so the timeout for any one
call to wait() was expected to be longer than the entire running time
of its test case.  AsyncTestCase.wait should save the timeout handle
it creates and cancel it before returning.

-Ben


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roey Berman  
View profile  
 More options Feb 13, 8:53 am
From: Roey Berman <roey.ber...@gmail.com>
Date: Mon, 13 Feb 2012 15:53:02 +0200
Local: Mon, Feb 13 2012 8:53 am
Subject: Re: [tornado] tornado.testing AsyncTestCase.wait() (v2.2)

I created a pull request for this issue:
https://github.com/facebook/tornado/pull/460


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »