Miscelaneous travis test failiures #2046

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

Comments

Projects
None yet
4 participants
@pelson
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

This comment has been minimized.

Show comment Hide comment
@pelson

pelson May 22, 2013

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

----------------------------------------------------------------------
Member

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

This comment has been minimized.

Show comment Hide comment
@mdboom

mdboom May 22, 2013

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

Owner

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

This comment has been minimized.

Show comment Hide comment
@tacaswell

tacaswell May 22, 2013

Owner

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

Owner

tacaswell commented May 22, 2013

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

This comment has been minimized.

Show comment Hide comment
@timj

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

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

This comment has been minimized.

Show comment Hide comment
@tacaswell

tacaswell Oct 12, 2015

Owner

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

Owner

tacaswell commented 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 tacaswell closed this Oct 12, 2015

@tacaswell

This comment has been minimized.

Show comment Hide comment
@tacaswell

tacaswell Oct 12, 2015

Owner

@timj See #5224

Owner

tacaswell commented Oct 12, 2015

@timj See #5224

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment