Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call gc.collect after each test only if the user asks for it #6707

Merged

Conversation

Kojoley
Copy link
Member

@Kojoley Kojoley commented Jul 8, 2016

Fixes #6705

@WeatherGod
Copy link
Member

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?

@WeatherGod
Copy link
Member

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'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name is a bit weird; you don't collect the GC, the GC does the collecting. Maybe just drop collect from the name.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was CALL_GC_COLLECT_AFTER_TEST and then I have reduced it.
I can't name things. T_T

@tacaswell tacaswell added this to the 2.1 (next point release) milestone Jul 8, 2016
@Kojoley Kojoley force-pushed the do-not-call-gc-collect-by-default branch 2 times, most recently from b1539ef to 85e9c80 Compare July 8, 2016 22:45
@jenshnielsen
Copy link
Member

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

@jenshnielsen
Copy link
Member

#6113 which is the same fix as #6120 has now been merged to master. If you rebase on top of current master this will hopefully start working as expected

@Kojoley Kojoley force-pushed the do-not-call-gc-collect-by-default branch from 85e9c80 to e6def4e Compare July 10, 2016 11:45
@Kojoley
Copy link
Member Author

Kojoley commented Jul 10, 2016

All tests have passed after rebasing. 👍

@jenshnielsen
Copy link
Member

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

@tacaswell tacaswell merged commit 7eab7d9 into matplotlib:master Jul 12, 2016
@Kojoley Kojoley deleted the do-not-call-gc-collect-by-default branch July 12, 2016 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants