Skip to content

test_simple_bind_fileno_invalid fails on aarch64-darwin #687

Open

Description

@debtquity

I am building 3.4.8 from source using nix and observe test_simple_bind_fileno_invalid fails only on aarch64-darwin platform. But, otherwise passes on aarch64-linux and x86_64-linux.

Per build history of this package [1], this is a new failure in 3.4.8. Might be related to #623.

...
=================================== FAILURES ===================================
______________ TestLdapCExtension.test_simple_bind_fileno_invalid ______________

self = <Tests.t_cext.TestLdapCExtension testMethod=test_simple_bind_fileno_invalid>

    @requires_init_fd()
    def test_simple_bind_fileno_invalid(self):
        fd = os.open(os.devnull, os.O_RDWR)
        l = _ldap.initialize_fd(fd, self.server.ldap_uri)
        with self.assertRaises(_ldap.SERVER_DOWN):
>           self._bind_conn(l)

Tests/t_cext.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def _bind_conn(self, l):
        # Perform a simple bind
        l.set_option(_ldap.OPT_PROTOCOL_VERSION, _ldap.VERSION3)
        m = l.simple_bind(self.server.root_dn, self.server.root_pw)
>       result, pmsg, msgid, ctrls = l.result4(m, _ldap.MSG_ONE, self.timeout)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       ldap.SUCCESS: {'result': 0, 'desc': 'Success', 'ctrls': []}

Tests/t_cext.py:115: SUCCESS
=========================== short test summary info ============================
FAILED Tests/t_cext.py::TestLdapCExtension::test_simple_bind_fileno_invalid - ldap.SUCCESS: {'result': 0, 'desc': 'Success', 'ctrls': []}
============= 1 failed, 261 passed, 1 skipped, 1 xfailed in 26.98s =============

[1] https://hydra.nixos.org/job/nixpkgs/unstable/python314Packages.python-ldap.aarch64-darwin

Activity

  1. spaceone commented on Oct 23, 2026

    @spaceone
    Contributor

    the reference is likely the cause - nothing else changed regarding this - (I assume you are upgrading from 3.4.7).

    Can you confirm that the following would not fail?

    diff --git Tests/t_cext.py Tests/t_cext.py
    index bc095fa6..504dc74a 100644
    --- Tests/t_cext.py
    +++ Tests/t_cext.py
    @@ -247,7 +247,7 @@ class TestLdapCExtension(SlapdTestCase):
     
         @requires_init_fd()
         def test_simple_bind_fileno_invalid(self):
    -        fd = os.open(os.devnull, os.O_RDWR)
    +        fd = os.open(os.devnull, os.O_RDONLY)
             l = _ldap.initialize_fd(fd, self.server.ldap_uri)
             with self.assertRaises(_ldap.SERVER_DOWN):
                 self._bind_conn(l)
    
    

    →

    @requires_init_fd()
    def test_simple_bind_fileno_invalid(self):
        fd = os.open(os.devnull, os.O_RDONLY)
        l = _ldap.initialize_fd(fd, self.server.ldap_uri)
        with self.assertRaises(_ldap.SERVER_DOWN):
            self._bind_conn(l)
        l.unbind_ext()
    
  2. debtquity commented on Oct 24, 2026

    @debtquity
    Author

    @spaceone I applied your patch to source and now the test passes on aarch64-darwin. It continues to pass on the *-linux platforms as well.

    Appreciate the help!

  3. spaceone commented on Oct 24, 2026

    @spaceone
    Contributor

    Thanks for the feedback. Then we will take that in.

    @mistotebe should be fine to have a read-only FD - as it's just a "faked" test.

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