Hello Laurent,

On 28 February 2012 18:08, Brack, Laurent P. <lpb...@dolby.com> wrote:
> Just wrote an infinite loop which never got preempted. I didn't have time to
> dig any deeper. Does the test need to be executed in a separate process via
> xdist?

xdist is not needed, in fact I haven't tried it but assume it will
behave fine.  By default SIGALM will be used which does have it's
limitations, the main issue is that it needs a chance to deliver the
signal to python code.  So depending on how your infinite loop is
written this might be an issue and you may have to consider
--nosigalrm which will use a timer thread (this is more expensive
obviously).  Could you show me the test function you where trying out?

> Also, currently the time out applies to all tests (and defaults to 5
> minutes). I think it would be useful to be able to override the timeout
> at the test level using markers. If something goes wrong and we have
> thousands of tests (we use pytest to test embedded systems), this is an
> awful lot of time to realize that things are DOA.

Yes, I agree with this and it is noted in the TODO file that
individual tests should have some control on the timeout and the
mechanism used (timer vs sigalrm).  But we only have about 10000 tests
running nightly with normally none blocking, this plugin was written
on the spur of the moment when we had about a dozen hanging and this
minimal functionality seemed to do the job.  It does assume hanging
tests are an exception rather then the norm, certainly evident from
the behaviour of --nosigalrm where os._exit() is called on a hanging
test.

I'm happy to work with you on adding a marker which will fulfil your
needs however.

Regards,
Floris


-- 
Debian GNU/Linux -- The Power of Freedom
www.debian.org | www.gnu.org | www.kernel.org
_______________________________________________
py-dev mailing list
py-dev@codespeak.net
http://codespeak.net/mailman/listinfo/py-dev

Reply via email to