Call gc.collect after each test only if the user asks for it#6707
Conversation
|
I have restarted the py2.7 test two times, and it has always failed in the same spot. The other tests are also taking longer to run. I wonder if the memory usage isn't staying low and is wasting time swap thrashing? |
|
The particular failure is one of those weird ones that we have been noticing (image size mismatch for the pdf comparison for the hatching test). Perhaps the gc.collect() was masking a deeper problem? |
| enabled = False | ||
|
|
||
| def options(self, parser, env=os.environ): | ||
| env_opt = 'COLLECT_GC_AFTER_TEST' |
There was a problem hiding this comment.
The name is a bit weird; you don't collect the GC, the GC does the collecting. Maybe just drop collect from the name.
There was a problem hiding this comment.
It was CALL_GC_COLLECT_AFTER_TEST and then I have reduced it.
I can't name things. T_T
b1539ef to
85e9c80
Compare
|
The failure was caused by an image in test_axes leaking into the test_backendpdf tests which runs right after the axes tests. See #6720 for the fix. It seems like the garbage collect mostly ensured that the figure was destroyed before the next test masking the missing cleanup decorator |
85e9c80 to
e6def4e
Compare
|
All tests have passed after rebasing. 👍 |
|
I'm 👍 on merging this now. It seems that the speedup is most significant on the single core tests (python 3.5 and OSX) but that is certainly important too |
Fixes #6705