Skip to content

Tests fail to run (killed manually after 7000 sec) #5446

Closed

Description

@msarahan

I'm building the matplotlib 1.5 package for Anaconda on Windows. This is using the split structure with matplotlib and matplotlib-tests introduced by @mdboom. Tests run, but seem to hang. I killed it after several hours:

import: matplotlib
....EC:\aroot\stage\lib\site-packages\matplotlib\_pylab_helpers.py:96: ResourceWarning: unclosed file <_io.BufferedWriter name=5>
  gc.collect(1)
C:\aroot\stage\lib\site-packages\matplotlib\_pylab_helpers.py:96: ResourceWarning: unclosed file <_io.BufferedReader name=7>
  gc.collect(1)
C:\aroot\stage\lib\site-packages\matplotlib\_pylab_helpers.py:96: ResourceWarning: unclosed file <_io.BufferedReader name=6>
  gc.collect(1)
KEKKKKK...KK.KK.....KK...KK.KK.KK.KK.....KK.KK.KK.KK...KK..........................KK.KK.KK.KK...KK.KK.KK.KK.KK.KK.KK.KK...KKC:\aroot\stage\lib\site-packages\dateutil\rrule.py:833: DeprecationWarning: fractions.gcd() is deprecated. Use math.gcd() instead.
  i_gcd = gcd(self._interval, base)
..KK.KK.KK.KK.KK.KK.....KK.KK.KK..KK.KK.KK.KK.KK.KK.KK.KK.KK......KK........KK.KK.KK.KK.....KK...KK.KK.KK.KK.KK.KK..KK.KK.KK...KK...........KK.KK.KK.KK.KK.KK.KK.KK.KK.KK.....KK...KK..KK.KK.KK.KK.............KK.KK.KK.KK.KK.KK.KK.KK.KK....KK......................................................KK....'gs' is not recognized as an internal or external command,
operable program or batch file.
'gs' is not recognized as an internal or external command,
operable program or batch file.
'latex' is not recognized as an internal or external command,
operable program or batch file.
'latex' is not recognized as an internal or external command,
operable program or batch file.
SSSSSSKKK....C:\aroot\stage\lib\site-packages\matplotlib\font_manager.py:1287: UserWarning: findfont: Font family ['Bitstream Vera Sans'] not found. Falling back to Helvetica
  (prop.get_family(), self.defaultFamily[fontext]))
.............KKKKKKKKKKKKKKK.KK....K..KK.KK.KK.KK........................S
======================================================================
ERROR: matplotlib.tests.test_animation.test_save_animation_smoketest('imagemagick', 'gif')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\aroot\stage\lib\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "C:\aroot\stage\lib\site-packages\matplotlib\testing\decorators.py", line 118, in wrapped_function
    func(*args, **kwargs)
  File "C:\aroot\stage\lib\site-packages\matplotlib\tests\test_animation.py", line 57, in check_save_animation
    anim.save(F.name, fps=30, writer=writer, bitrate=500)
  File "C:\aroot\stage\lib\site-packages\matplotlib\animation.py", line 780, in save
    writer.grab_frame(**savefig_kwargs)
  File "C:\aroot\stage\lib\site-packages\matplotlib\animation.py", line 225, in grab_frame
    dpi=self.dpi, **savefig_kwargs)
  File "C:\aroot\stage\lib\site-packages\matplotlib\figure.py", line 1539, in savefig
    self.canvas.print_figure(*args, **kwargs)
  File "C:\aroot\stage\lib\site-packages\matplotlib\backend_bases.py", line 2230, in print_figure
    **kwargs)
  File "C:\aroot\stage\lib\site-packages\matplotlib\backends\backend_agg.py", line 519, in print_raw
    fileobj.write(renderer._renderer.buffer_rgba())
OSError: [Errno 22] Invalid argument

======================================================================
ERROR: matplotlib.tests.test_animation.test_save_animation_smoketest('imagemagick_file', 'gif')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\aroot\stage\lib\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "C:\aroot\stage\lib\site-packages\matplotlib\testing\decorators.py", line 118, in wrapped_function
    func(*args, **kwargs)
  File "C:\aroot\stage\lib\site-packages\matplotlib\tests\test_animation.py", line 57, in check_save_animation
    anim.save(F.name, fps=30, writer=writer, bitrate=500)
  File "C:\aroot\stage\lib\site-packages\matplotlib\animation.py", line 780, in save
    writer.grab_frame(**savefig_kwargs)
  File "C:\aroot\stage\lib\contextlib.py", line 66, in __exit__
    next(self.gen)
  File "C:\aroot\stage\lib\site-packages\matplotlib\animation.py", line 191, in saving
    self.finish()
  File "C:\aroot\stage\lib\site-packages\matplotlib\animation.py", line 382, in finish
    + ' Try running with --verbose-debug')
RuntimeError: Error creating movie, return code: 4 Try running with --verbose-debug

----------------------------------------------------------------------
Ran 517 tests in 6983.421s

FAILED (KNOWNFAIL=207, SKIP=7, errors=2)
C:\aroot\stage\lib\site-packages\matplotlib\__init__.py:1350: UserWarning:  This call to matplotlib.use() has no effect
because the backend has already been chosen;
matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time.

  warnings.warn(_use_error_msg)
===== matplotlib-1.5.0 OK =====
Traceback (most recent call last):
  File "C:\Users\builder\Miniconda2\Scripts\build-script.py", line 9, in <module>
    load_entry_point('abts==0.0.0', 'console_scripts', 'build')()
  File "z:\documents\code\anaconda\bt\build.py", line 428, in main
    build(pkg, only_build = opts.only_build)
  File "z:\documents\code\anaconda\bt\build.py", line 327, in build
    test(pkg)
  File "z:\documents\code\anaconda\bt\build.py", line 372, in test
    env=env, cwd=tmp_dir)
  File "C:\Users\builder\Miniconda2\lib\subprocess.py", line 535, in check_call
    retcode = call(*popenargs, **kwargs)
  File "C:\Users\builder\Miniconda2\lib\subprocess.py", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
  File "C:\Users\builder\Miniconda2\lib\subprocess.py", line 1007, in wait
    _subprocess.INFINITE)
KeyboardInterrupt

Activity

  1. mdboom commented on Nov 9, 2015

    @mdboom
    Member

    Is ImageMagick installed? Perhaps it's not correctly detecting that it isn't...?

    Cc: @cgohlke as our Windows expert. Have you ever seen this test fail in this way?

  2. cgohlke commented on Nov 9, 2015

    @cgohlke
    Contributor

    As for Imagemagick, see https://github.com/matplotlib/matplotlib/blob/master/matplotlibrc.template#L509

    I have to disable PEP8 tests for the tests to finish.

  3. mdboom commented on Nov 9, 2015

    @mdboom
    Member

    Do you have any thoughts about how we might detect that convert is the system tool? Then we could update our ImageMagick detect function to return False in that case...

  4. WeatherGod commented on Nov 9, 2015

    @WeatherGod
    Member

    We had to do something special for convert for animations at one point.
    @dopplershift, do you recall that?

    On Mon, Nov 9, 2015 at 11:56 AM, Michael Droettboom <
    notifications@github.com> wrote:

    Do you have any thoughts about how we might detect that convert is the
    system tool? Then we could update our ImageMagick detect function to return
    False in that case...

    —
    Reply to this email directly or view it on GitHub
    #5446 (comment)
    .

  5. dopplershift commented on Nov 9, 2015

    @dopplershift
    Contributor

    Only thing I can find is a mention on #1337. The solution was to force the path to imagemagick convert in matplotlibrc.

    Would be nice to blacklist the system version, but the only way I can think of is to pass a new %PATH% to subprocess on windows, modifying the environment one to remove system dirs....which sounds terrible.

  6. msarahan commented on Nov 9, 2015

    @msarahan
    ContributorAuthor

    Test suite does not run for me specifying --omit-pep8 as outlined in docs at http://matplotlib.org/devel/testing.html:

    C:\Users\builder\Miniconda2\conda-bld\work\matplotlib-1.5.0>python setup.py test --omit-pep8
    ============================================================================
    Edit setup.cfg to change the build options
    
    BUILDING MATPLOTLIB
                matplotlib: yes [1.5.0]
                    python: yes [3.4.3 |Continuum Analytics, Inc.| (default, Nov
                            7 2015, 10:06:50) [MSC v.1600 32 bit (Intel)]]
                  platform: yes [win32]
    
    REQUIRED DEPENDENCIES AND EXTENSIONS
                     numpy: yes [version 1.10.1]
                  dateutil: yes [using dateutil version 2.4.2]
                      pytz: yes [using pytz version 2015.7]
                    cycler: yes [using cycler version 0.9.0]
                   tornado: yes [using tornado version 4.2.1]
                 pyparsing: yes [using pyparsing version 2.0.3]
                    libagg: yes [pkg-config information for 'libagg' could not
                            be found. Using local copy.]
                  freetype: yes [Using unknown version found on system.]
                       png: yes [Using unknown version found on system.]
                     qhull: yes [pkg-config information for 'qhull' could not be
                            found. Using local copy.]
    
    OPTIONAL SUBPACKAGES
               sample_data: yes [installing]
                  toolkits: yes [installing]
                     tests: no  [skipping due to configuration]
            toolkits_tests: no  [toolkits_tests needs 'toolkits' and 'tests']
    
    OPTIONAL BACKEND EXTENSIONS
                    macosx: no  [Mac OS-X only]
                    qt5agg: no  [PyQt5 not found]
                    qt4agg: yes [installing, Qt: 4.8.7, PyQt: 4.8.7; PySide not
                            found]
                   gtk3agg: no  [Requires pygobject to be installed.]
                 gtk3cairo: no  [Requires cairocffi or pycairo to be installed.]
                    gtkagg: no  [Requires pygtk]
                     tkagg: yes [installing, version not identified]
                     wxagg: no  [requires wxPython]
                       gtk: no  [Requires pygtk]
                       agg: yes [installing]
                     cairo: no  [cairocffi or pycairo not found]
                 windowing: yes [installing, installing]
    
    OPTIONAL LATEX DEPENDENCIES
                    dvipng: no
               ghostscript: no
                     latex: no
                   pdftops: no
    
    OPTIONAL PACKAGE DATA
                      dlls: no  [skipping due to configuration]
    
    running test
    Traceback (most recent call last):
      File "setup.py", line 383, in <module>
        **extra_args
      File "C:\Users\builder\Miniconda2\envs\_build\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "C:\Users\builder\Miniconda2\envs\_build\lib\distutils\dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "C:\Users\builder\Miniconda2\envs\_build\lib\distutils\dist.py", line 973, in run_command
        cmd_obj.ensure_finalized()
      File "C:\Users\builder\Miniconda2\envs\_build\lib\distutils\cmd.py", line 107, in ensure_finalized
        self.finalize_options()
      File "setup.py", line 160, in finalize_options
        self.test_args = []
    AttributeError: can't set attribute
    

    Side note: it would be really nice to have these options pass-able to your matplotlib.test() function, not just as command-line flags.

  7. jenshnielsen commented on Nov 9, 2015

    @jenshnielsen
    Member

    Try running it via python tests.py the setup.py test entry point have issues (#5315) and we are likely to get rid of it again (#5434)

  8. jenshnielsen commented on Nov 9, 2015

    @jenshnielsen
    Member

    Confusingly you need to add --no-pep8 rather than --omit-pep8 to tests.py

  9. msarahan commented on Nov 10, 2015

    @msarahan
    ContributorAuthor

    Just a little background info: @mdboom tried to split up tests from the Matplotlib package for Continuum. This complicated the situation a fair bit. The easiest solution for me ended up being to patch matplotlib/__init__.py and kill test_coding_standards directly there. I now just import matplotlib, and call matplotlib.tests()

    Closing this issue. @cgohlke thanks for the pep8 hint.

  10. mdboom commented on Nov 10, 2015

    @mdboom
    Member

    Just for the sake of clarity: The matplotlib tests were never run as part of the anaconda build before -- just a little import smoke test. So this is the first time tests have been running as part of anaconda builds as far as I know.

    As far as an upstream fix (so the patch is no longer necessary), we could mark the pep8 test as knownfail on Windows.

    So the ImageMagick problem was just a red herring that removing the PEP8 test resolved? Or are we still having issues with ImageMagick on Windows?

  11. msarahan commented on Nov 10, 2015

    @msarahan
    ContributorAuthor

    Good question. I installed imagemagick before I tried the pep8 stuff. It
    didn't fix things, but I didn't remove it. There are still several errors
    in testing, 2-3 of which mention imagemagick animations, but the build
    system doesn't seem to care.

    On Tue, Nov 10, 2015 at 12:43 PM Michael Droettboom <
    notifications@github.com> wrote:

    Just for the sake of clarity: The matplotlib tests were never run as part
    of the anaconda build before -- just a little import smoke test. So this is
    the first time tests have been running as part of anaconda builds as far as
    I know.

    As far as an upstream fix (so the patch is no longer necessary), we could
    mark the pep8 test as knownfail on Windows.

    So the ImageMagick problem was just a red herring that removing the PEP8
    test resolved? Or are we still having issues with ImageMagick on Windows?

    —
    Reply to this email directly or view it on GitHub
    #5446 (comment)
    .

  12. cgohlke commented on Nov 10, 2015

    @cgohlke
    Contributor

    Imagemagick convert works on Windows if animation.convert_path is set to the full path in matplotlibrc, for example to X:\ImageMagick\convert (without quotes!).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions