Cleanups not run after twisted test times out

Bug #897196 reported by Jonathan Lange
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
testtools
Triaged
Medium
Unassigned

Bug Description

If you're writing tests using AsynchronousDeferredRunTest and the test times out then cleanups aren't run. This is a problem because it often screws up the rest of the test run or leaves crap running on your system that should have been torn down.

The current behaviour is somewhat understandable, the whole test – setUp, test, tearDown, cleanups – are stuck in one thing and a timeout is placed on the whole lot. And indeed, we will probably always need some sort of timeout like that to prevent tests stalling due to rogue cleanups.

However, it's a pretty common case for the crazy, broken, not-working stuff that causes the timeout to be in the test itself and for the cleanups to be fairly reliable. There ought to be a way to specify a tighter timeout for the test itself and a more generous one for the surrounding set up and tear down.

Tags: twisted
Jonathan Lange (jml)
affects: python-fixtures → testtools
Jonathan Lange (jml)
tags: added: twisted
Changed in testtools:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Jonathan Lange (jml) wrote :

One solution to this would be to expose a fixture from the runtest such that test could register cleanups & fixtures on *that*. The runtest could then run this fixture outside the framework of the test (in this case, outside the call to Spinner.run).

AsynchronousDeferredRunTest now actually has a thing for this in `_get_log_fixture`. The issue is how to safely & sanely expose this to the end user.

More broadly, I think the RunTest interface is flawed in many ways and that perhaps we should pursue alternative routes.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.