[TIP] aborting tests that take too long

Alfredo Deza alfredodeza at gmail.com
Fri Nov 11 08:44:49 PST 2011

On Fri, Nov 11, 2011 at 10:54 AM, Mark Sienkiewicz <sienkiew at stsci.edu>wrote:

> On 11/11/11 10:06, Michael Foord wrote:
>> On 11 Nov 2011, at 01:54, Gary Bernhardt wrote:
>>  I can't resist...
>>> os.system("(sleep 30&&  kill %s)&" % os.getpid())
>> That would require running each test in a separate process (or providing
>> a test *run* timeout rather than a test timeout) - which faulthandler
>> doesn't. :-p
> It's a bit weak in the reporting area too. :)
> Seriously, though, I AM going to implement something similar.  In my
> system a "test run" involves hundreds of processes running tests with many
> different test runners.  If a particular instance of a test runner does not
> implement time limits, the control system can kill it eventually.  So,
> first level is that faulthandler can interrupt a particular test and report
> what test ran over, second level is a test runner can get killed and report
> what file ran over, and third level is that the CI system can decide that
> the set of all tests is taking too long.
> Now, all I have to do now is implement all that...

There is some features in the workings for py.test that would allow
reporting execution times for tests, given a nice API for this adding some
that plugs into it would be trivial.

Nothing that would help you *right now* though :(

> Mark S.
> ______________________________**_________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.**org <testing-in-python at lists.idyll.org>
> http://lists.idyll.org/**listinfo/testing-in-python<http://lists.idyll.org/listinfo/testing-in-python>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20111111/2ba762e3/attachment.htm>

More information about the testing-in-python mailing list