Opened 15 years ago

Last modified 15 years ago

#2652 enhancement new

trial should call gc.collect() at the end

Reported by: Jean-Paul Calderone Owned by:
Priority: normal Milestone:
Component: trial Keywords:
Cc: Branch:
Author:

Description

because otherwise stuff might not be collected and information will get lost.

For example, if a test method creates a Deferred and errbacks it, if it also doesn't return it (because, say, an assertion fails and it raises an exception before it can return), the Deferred's error will only be logged when the Deferred happens to get garbage collected. If trial explicitly calls gc.collect(), the Deferred should be collected in most cases.

Change History (3)

comment:1 Changed 15 years ago by radix

To clarify, exarkun meant the end, like after all tests are run. This means that exceptions in Deferreds will at least be printed to the log. There are cases where unhandled errors in deferreds won't be logged at all right now, and this will fix that (?).

comment:2 Changed 15 years ago by Jonathan Lange

Yeah, I got that.

There's already a way to run gc.collect() at the very end of the test run: --force-gc. The real problem is gc.collect() should be run at the very end, even when --force-gc isn't specified.

comment:3 Changed 11 years ago by <automation>

Owner: Jonathan Lange deleted
Note: See TracTickets for help on using tickets.