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

Test failure with mutagen >= 1.33 #2153

Closed
bjornfor opened this issue Aug 2, 2016 · 5 comments
Closed

Test failure with mutagen >= 1.33 #2153

bjornfor opened this issue Aug 2, 2016 · 5 comments

Comments

@bjornfor
Copy link

bjornfor commented Aug 2, 2016

Problem

(Sorry for skipping the issue template, but it seemed aimed at different kind of issues. I think this is a good format for humans.)

When building beets against mutagen >= 1.33 (tested 1.33 and 1.34 (latest)), the following test failure happens:

test_no_patterns (test.test_zero.ZeroPluginTest) ... ok
test_patterns (test.test_zero.ZeroPluginTest) ... ok

======================================================================
ERROR: test_broken_symlink (test.test_mediafile_edge.SafetyTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/nix-build-beets-1.3.19.drv-0/beets-v1.3.19-src/test/test_mediafile_edge.py", line 196, in test_broken_symlink
    beets.mediafile.MediaFile, fn)
  File "/nix/store/3wl86vswinz1cam7jmzdvvaglg2566l6-python-2.7.12/lib/python2.7/unittest/case.py", line 473, in assertRaises
    callableObj(*args, **kwargs)
  File "/tmp/nix-build-beets-1.3.19.drv-0/beets-v1.3.19-src/beets/mediafile.py", line 1377, in __init__
    raise MutagenError(path, exc)
MutagenError: /tmp/nix-build-beets-1.3.19.drv-0/beets-v1.3.19-src/test/rsrc/brokenlink: [Errno 2] No such file or directory: '/tmp/nix-build-beets-1.3.19.drv-0/beets-v1.3.19-src/test/rsrc/brokenlink'
-------------------- >> begin captured logging << --------------------
beets: DEBUG: Traceback (most recent call last):
  File "/tmp/nix-build-beets-1.3.19.drv-0/beets-v1.3.19-src/beets/mediafile.py", line 1361, in __init__
    self.mgfile = mutagen.File(path)
  File "/nix/store/qiac3k1wcr69mfcmlczkxcj5fa0p4bp7-python2.7-mutagen-1.33/lib/python2.7/site-packages/mutagen/_util.py", line 105, in wrapper_func
    writable, create) as h:
  File "/nix/store/3wl86vswinz1cam7jmzdvvaglg2566l6-python-2.7.12/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/nix/store/qiac3k1wcr69mfcmlczkxcj5fa0p4bp7-python2.7-mutagen-1.33/lib/python2.7/site-packages/mutagen/_util.py", line 192, in _openfile
    raise MutagenError(e)
MutagenError: [Errno 2] No such file or directory: '/tmp/nix-build-beets-1.3.19.drv-0/beets-v1.3.19-src/test/rsrc/brokenlink'

beets: ERROR: uncaught Mutagen exception in open: [Errno 2] No such file or directory: '/tmp/nix-build-beets-1.3.19.drv-0/beets-v1.3.19-src/test/rsrc/brokenlink'
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 1682 tests in 68.862s

FAILED (SKIP=21, errors=1)
builder for ‘/nix/store/139y94l5a6zg78q8nymfzld36vninhh5-beets-1.3.19.drv’ failed with exit code 1
error: build of ‘/nix/store/139y94l5a6zg78q8nymfzld36vninhh5-beets-1.3.19.drv’ failed

I guess this is easily "solveable" by restricting the mutagen version spec in setup.py (currently 'mutagen>=1.27'). But as someone who is involved with distro packaging (NixOS) I kindly ask if you can try to be compatible with the new version instead. (Strict version requirements makes packaging difficult.)

@sampsyo
Copy link
Member

sampsyo commented Aug 2, 2016

Interesting! Thanks for the report. I can't reproduce this here—we do indeed regularly test with the latest Mutagen. You can see the versions at the top of the CI log here: https://travis-ci.org/beetbox/beets/jobs/149035232

Is there any chance this might be Nix-specific? Or that you've got an older version of the source? In particular, that raise MutagenError line is inside a handler that should have caught the IOError you're seeing there separately.

@sampsyo
Copy link
Member

sampsyo commented Aug 2, 2016

It looks like something may have gotten out of sync with the exception hierarchy rework in this commit: 629241e

There are some other problems here that I will try addressing now. I'll likely end up requiring Mutagen >= 1.33. When that's done, can you give things a try again to see if you still see the problem?

@bjornfor
Copy link
Author

bjornfor commented Aug 2, 2016

@sampsyo: I forgot to say that this is with beets 1.3.19 (latest release). (Although that can be seen in the build log.) In your build log I see beets 1.4.0, which is still unreleased, as far as I can tell.

When that's done, can you give things a try again to see if you still see the problem?

Sure. But I'm kind of busy for the next three weeks, I'll see what I can do. If you manage to reproduce the error with beets 1.3.19 and mutagen 1.33/34, that'd be great. This issue is three steps off my road towards a goal. Yak shaving... :-)

@sampsyo
Copy link
Member

sampsyo commented Aug 2, 2016

Ah, got it. Here's the problem: when beets 1.3.19 was released, Mutagen 1.33 didn't exist yet. When that was released, it changed the way exceptions work, which broke those tests. We've since fixed compatibility with the latest version, but we can't go back in time and change the version specifier for 1.3.19.

But the 1.4.0 release should be right around the corner, so this should all be over soon. Back to shaving other yaks. 😃

@sampsyo sampsyo closed this as completed Aug 2, 2016
@bjornfor
Copy link
Author

bjornfor commented Aug 2, 2016

@sampsyo: Thank you!

bjornfor added a commit to NixOS/nixpkgs that referenced this issue Aug 2, 2016
(Not updating to the latest version, 1.34, because it breaks e.g.
'beets'. See beetbox/beets#2153.)

The new version requires locale / i18n to be set-up for tests or else
this message is thrown:

  RuntimeError: This test suite needs a unicode locale encoding. Try setting LANG=C.UTF-8

Also, remove a test that currently fails due to the python builder in
nixpkgs. PR with fix: #17430
("python: add file encoding to run_setup.py").
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

2 participants