[Twisted-Python] Re: [Twisted-commits] r15819 - Maybe make this test more robust. Windows sucks.

Jonathan Lange jml at mumak.net
Fri Feb 3 16:08:04 MST 2006


On 2/4/06, Jean-Paul Calderone <exarkun at divmod.com> wrote:
> On Fri, 03 Feb 2006 00:30:41 -0700, Jonathan Lange <jml at wolfwood.twistedmatrix.com> wrote:
> >Author: jml
> >Date: Fri Feb  3 00:30:40 2006
> >New Revision: 15819
> >
> >Modified:
> >   trunk/twisted/trial/test/test_reporter.py
> >Log:
> >Maybe make this test more robust. Windows sucks.
> >
> >Modified: trunk/twisted/trial/test/test_reporter.py
> >==============================================================================
> >--- trunk/twisted/trial/test/test_reporter.py  (original)
> >+++ trunk/twisted/trial/test/test_reporter.py  Fri Feb  3 00:30:40 2006
> >@@ -42,6 +42,7 @@
> >     def test_timing(self):
> >         the_reporter = reporter.Reporter()
> >         the_reporter._somethingStarted()
> >+        time.sleep(0.01)
> >         the_reporter._somethingStarted()
> >         time.sleep(0.01)
> >         time1 = the_reporter._somethingStopped()
>
> I think robustness is inversely correlated with number of time-related calls.
>
> What are these sleeps for?  Maybe the reporter's timing function should be parameterized so this can be deterministic, instead of relying on a clock that is guaranteed to say something nasty from time to time?
>

As I understand it, this test is there to check that the reporter
actually does timing, and that the _somethingStarted() fu operates as
a stack _and_ that _somethingStopped() returns a time.

Patches accepted.

jml




More information about the Twisted-Python mailing list