You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is a bucket for test failures which have occurred on the travis tests, probably related to the fact that the tests are run in parallel.
I'm not unduly worried by these failures - it is something I'd like to fix, but not something which needs to hold up a release.
The problems will inevitably prove hard to reproduce and will be dependent on test execution order (which changes with hash ordering and performance of particular nodes).
======================================================================
ERROR: matplotlib.tests.test_axes.test_arc_ellipse.test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/virtualenv/python2.7/local/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/travis/virtualenv/python2.7/local/lib/python2.7/site-packages/matplotlib-1.3.x-py2.7-linux-x86_64.egg/matplotlib/testing/decorators.py", line 40, in failer
result = f(*args, **kwargs)
File "/home/travis/virtualenv/python2.7/local/lib/python2.7/site-packages/matplotlib-1.3.x-py2.7-linux-x86_64.egg/matplotlib/testing/decorators.py", line 149, in do_test
self._tol, in_decorator=True)
File "/home/travis/virtualenv/python2.7/local/lib/python2.7/site-packages/matplotlib-1.3.x-py2.7-linux-x86_64.egg/matplotlib/testing/compare.py", line 293, in compare_images
expected = convert(expected, True)
File "/home/travis/virtualenv/python2.7/local/lib/python2.7/site-packages/matplotlib-1.3.x-py2.7-linux-x86_64.egg/matplotlib/testing/compare.py", line 187, in convert
cache_dir = get_cache_dir()
File "/home/travis/virtualenv/python2.7/local/lib/python2.7/site-packages/matplotlib-1.3.x-py2.7-linux-x86_64.egg/matplotlib/testing/compare.py", line 108, in get_cache_dir
os.makedirs(cache_dir)
File "/home/travis/virtualenv/python2.7/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 17] File exists: '/home/travis/.matplotlib/test_cache'
----------------------------------------------------------------------
File "/home/travis/virtualenv/python2.7/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 17] File exists: '/home/travis/.matplotlib/test_cache'
This is actually an easy one to fix. It should be using cbook.makedirs instead, which is multi-process safe because it mutes the exception if the directory happens to be created between the time it checks for its existence and its actual creation. I thought I had changed all instances of this when I made the parallel testing PR, but obviously I missed one. See #2049.
I like the idea of this "thread" though, so let's keep it open.
======================================================================
ERROR: matplotlib.tests.test_bbox_tight.test_bbox_inches_tight_suptile_legend.test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/virtualenv/python3.3/lib/python3.3/site-packages/nose/case.py", line 198, in runTest
self.test(*self.arg)
File "/home/travis/virtualenv/python3.3/lib/python3.3/site-packages/matplotlib-1.3.x-py3.3-linux-x86_64.egg/matplotlib/testing/decorators.py", line 40, in failer
result = f(*args, **kwargs)
File "/home/travis/virtualenv/python3.3/lib/python3.3/site-packages/matplotlib-1.3.x-py3.3-linux-x86_64.egg/matplotlib/testing/decorators.py", line 149, in do_test
self._tol, in_decorator=True)
File "/home/travis/virtualenv/python3.3/lib/python3.3/site-packages/matplotlib-1.3.x-py3.3-linux-x86_64.egg/matplotlib/testing/compare.py", line 308, in compare_images
rms = calculate_rms(expectedImage, actualImage)
File "/home/travis/virtualenv/python3.3/lib/python3.3/site-packages/matplotlib-1.3.x-py3.3-linux-x86_64.egg/matplotlib/testing/compare.py", line 246, in calculate_rms
abs_diff_image = abs(expectedImage - actualImage)
ValueError: operands could not be broadcast together with shapes (593,919,3) (590,919,3)
----------------------------------------------------------------------
@mdboom I don't think the cbook.makedirs code catches all the problems with multi-threading. We are seeing a very rare failure in the LSST test suite when multiple tests are using matplotlib in parallel. I think it is because the try/catch in makedirs is assuming that only the last part of the path could have the race and only does a single catch around the entire for loop. If both processes are racing to create path A/B/C and both are notice that B is missing then the second one to attempt to create B will abort when it finds that B now exists. It should just continue on with trying to make C. I think the try/catch should be in the inner part of the loop around the os.makedirs call.
Activity
pelson commentedon May 22, 2013
mdboom commentedon May 22, 2013
This is actually an easy one to fix. It should be using
cbook.makedirsinstead, which is multi-process safe because it mutes the exception if the directory happens to be created between the time it checks for its existence and its actual creation. I thought I had changed all instances of this when I made the parallel testing PR, but obviously I missed one. See #2049.I like the idea of this "thread" though, so let's keep it open.
tacaswell commentedon May 22, 2013
https://travis-ci.org/matplotlib/matplotlib/jobs/7337969
Only showed up in 3.3
timj commentedon Sep 16, 2015
@mdboom I don't think the
cbook.makedirscode catches all the problems with multi-threading. We are seeing a very rare failure in the LSST test suite when multiple tests are using matplotlib in parallel. I think it is because the try/catch inmakedirsis assuming that only the last part of the path could have the race and only does a single catch around the entire for loop. If both processes are racing to create pathA/B/Cand both are notice thatBis missing then the second one to attempt to createBwill abort when it finds thatBnow exists. It should just continue on with trying to makeC. I think the try/catch should be in the inner part of the loop around theos.makedirscall.This is the error we get:
with v1.4.3.
I can file a new issue if you prefer. I just used this as it was open already and related.
tacaswell commentedon Oct 12, 2015
@timj Can you make a new issue? That makes it easier to track.
I am going to close this issue as until last month it had not been touched for 2 years.
tacaswell commentedon Oct 12, 2015
@timj See #5224