Cleanups not run after twisted test times out
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
testtools |
Triaged
|
Medium
|
Unassigned |
Bug Description
If you're writing tests using AsynchronousDef
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.
affects: | python-fixtures → testtools |
tags: | added: twisted |
Changed in testtools: | |
status: | New → Triaged |
importance: | Undecided → Medium |
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).
AsynchronousDef erredRunTest 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.