spl0k / supysonic

Supysonic is a Python implementation of the Subsonic server API.
https://supysonic.readthedocs.io
GNU Affero General Public License v3.0
259 stars 57 forks source link

Testsuite failure using ponyorm v0.7.15rc1 (py3.9 and py3.10) #229

Closed baldurmen closed 2 years ago

baldurmen commented 2 years ago

Hello!

PonyORM v0.7.15rc1 is finally out, with python 3.10 support. Building the supysonic Debian package with the new pony, the supysonic testsuite fails (both with python 3.9 and 3.10) with this error:

======================================================================
FAIL: test_add_nowait_stop (tests.base.test_watcher.AudioWatcherTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/tests/base/test_watcher.py", line 117, in test_add_nowait_stop
    self.assertTrackCountEqual(1)
  File "<decorator-gen-53>", line 2, in assertTrackCountEqual
  File "/usr/lib/python3/dist-packages/pony/orm/core.py", line 531, in new_func
    result = func(*args, **kwargs)
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/tests/base/test_watcher.py", line 106, in assertTrackCountEqual
    self.assertEqual(Track.select().count(), expected)
AssertionError: 0 != 1

Why it does, no idea :)

I can also reproduce this in a venv using pip, although it requires some massaging to install supysonic with python3.10 and pony 0.7.15rc1

Happy to test things if needed!

spl0k commented 2 years ago

Hello.

This isn't the first time I see this test fail, and I never figured out why it fails, plus it doesn't always fail... I'm suspecting this is coming from the tests themselves (how they are set up) rather than anything else, as I'm also getting failures on Python 3.8 with Pony 0.7.14. Actually this isn't the only one to fail sporadically, some other about cover art tend to fail also. The thing in common on all these is that they all involve the watcher.

Examples of other failures I just got a few minutes ago:

======================================================================
FAIL: test_add_cover_then_file (tests.base.test_watcher.CoverWatcherTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/media/sf_projects/supysonic/tests/base/test_watcher.py", line 265, in test_add_cover_then_file
    self.assertEqual(Folder.select().first().cover_art, os.path.basename(path))
AssertionError: None != 'tmp6pp33o4t.jpg'

======================================================================
FAIL: test_naming_add_good (tests.base.test_watcher.CoverWatcherTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/media/sf_projects/supysonic/tests/base/test_watcher.py", line 285, in test_naming_add_good
    self.assertEqual(Folder.select().first().cover_art, good)
AssertionError: 'tmpv9qit9fa.jpg' != 'tmphxghu1mfcover.jpg'
- tmpv9qit9fa.jpg
+ tmphxghu1mfcover.jpg
baldurmen commented 2 years ago

Thanks, that's helpful. I'll skip this one and won't delay releasing the latest supysonic release in Debian unstable then.