Skip to content

Multiple tests fail with "Failed: Wrong reference count, expected 2-1024 and got 1" with Python 3.14(-a7) #31

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

Open
szpak opened this issue Apr 14, 2025 · 0 comments

Comments

@szpak
Copy link

szpak commented Apr 14, 2025

As detected by the Fedora team, multiple test fails with Python 3.14(-a7).

Sample failure:

_________________________ TestModification.test_append _________________________

self = <test_acls.TestModification object at 0x7f42405dc550>

    def test_append(self):
        """Test append a new Entry to the ACL"""
        acl = posix1e.ACL()
        e = acl.append()
        e.tag_type = posix1e.ACL_OTHER
        ignore_ioerror(errno.EINVAL, acl.calc_mask)
        str_format = str(e)
>       self.checkRef(str_format)

tests/test_acls.py:589: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_acls.TestModification object at 0x7f42405dc550>
obj = 'ACL entry for the others'

    def checkRef(self, obj):
        """Checks if a given obj has a 'sane' refcount"""
        if platform.python_implementation() == "PyPy":
            return
        ref_cnt = sys.getrefcount(obj)
        # FIXME: hardcoded value for the max ref count... but I've
        # seen it overflow on bad reference counting, so it's better
        # to be safe
        if ref_cnt < 2 or ref_cnt > 1024:
>           pytest.fail("Wrong reference count, expected 2-1024 and got %d" %
                        ref_cnt)
E           Failed: Wrong reference count, expected 2-1024 and got 1

tests/test_acls.py:573: Failed

Reproduced with GH actions:
https://github.com/szpak-forks/pylibacl/actions/runs/14450020969/job/40520116539?pr=1#step:7:43

See:
#30

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

1 participant