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

Miscelaneous travis test failiures #2046

Closed
pelson opened this issue May 22, 2013 · 6 comments
Closed

Miscelaneous travis test failiures #2046

pelson opened this issue May 22, 2013 · 6 comments

Comments

@pelson
Copy link
Member

pelson commented May 22, 2013

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).

@pelson
Copy link
Member Author

pelson commented May 22, 2013

======================================================================
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'

----------------------------------------------------------------------

@mdboom
Copy link
Member

mdboom commented May 22, 2013

  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.

@tacaswell
Copy link
Member

https://travis-ci.org/matplotlib/matplotlib/jobs/7337969

======================================================================
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) 
----------------------------------------------------------------------

Only showed up in 3.3

@timj
Copy link

timj commented Sep 16, 2015

@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.

This is the error we get:

import matplotlib.colorbar
  File "/home/vagrant/stack/Linux64/anaconda/2.2.0/lib/python2.7/site-packages/matplotlib/colorbar.py", line 36, in <module>
    import matplotlib.contour as contour
  File "/home/vagrant/stack/Linux64/anaconda/2.2.0/lib/python2.7/site-packages/matplotlib/contour.py", line 27, in <module>
    import matplotlib.texmanager as texmanager
  File "/home/vagrant/stack/Linux64/anaconda/2.2.0/lib/python2.7/site-packages/matplotlib/texmanager.py", line 89, in <module>
    class TexManager:
  File "/home/vagrant/stack/Linux64/anaconda/2.2.0/lib/python2.7/site-packages/matplotlib/texmanager.py", line 124, in TexManager
    mkdirs(texcache)
  File "/home/vagrant/stack/Linux64/anaconda/2.2.0/lib/python2.7/site-packages/matplotlib/cbook.py", line 1003, in mkdirs
    os.makedirs(thispart, mode)
  File "/home/vagrant/stack/Linux64/anaconda/2.2.0/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 17] File exists: '/tmp/matplotlib-vagrant'

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

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

@timj See #5224

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

No branches or pull requests

4 participants