Skip to content

test failures with python 3.12 #560

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
ncopa opened this issue Mar 28, 2024 · 3 comments
Open

test failures with python 3.12 #560

ncopa opened this issue Mar 28, 2024 · 3 comments

Comments

@ncopa
Copy link

ncopa commented Mar 28, 2024

Issue description:

...
test_weird_empty_lines (Tests.t_ldif.TestEntryRecords.test_weird_empty_lines) ... ok
test_syncidset_message (Tests.t_ldap_syncrepl.DecodeSyncreplProtoTests.test_syncidset_message)
A syncrepl server may send a sync info message, with a syncIdSet ... ok
test_refreshAndPersist_cancelled (Tests.t_ldap_syncrepl.TestSyncrepl.test_refreshAndPersist_cancelled)
Make sure refreshAndPersist can handle cancelling a syncrepl search. ... ok
test_refreshAndPersist_poll_only (Tests.t_ldap_syncrepl.TestSyncrepl.test_refreshAndPersist_poll_only)
Test the refresh part of refresh-and-persist, and check what we got. ... ERROR
test_refreshAndPersist_search (Tests.t_ldap_syncrepl.TestSyncrepl.test_refreshAndPersist_search) ... ERROR
test_refreshAndPersist_timeout (Tests.t_ldap_syncrepl.TestSyncrepl.test_refreshAndPersist_timeout)
Make sure refreshAndPersist can handle a search with timeouts. ... ERROR
test_refreshOnly_poll_full (Tests.t_ldap_syncrepl.TestSyncrepl.test_refreshOnly_poll_full)
Test doing a full refresh cycle, and check what we got. ... ERROR
test_refreshOnly_search (Tests.t_ldap_syncrepl.TestSyncrepl.test_refreshOnly_search)
Test to see if we can initialize a syncrepl search. ... ERROR

======================================================================
ERROR: test_refreshAndPersist_poll_only (Tests.t_ldap_syncrepl.TestSyncrepl.test_refreshAndPersist_poll_only)
Test the refresh part of refresh-and-persist, and check what we got.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ncopa/aports/community/py3-ldap/src/python-ldap-python-ldap-3.4.4/Tests/t_ldap_syncrepl.py", line 436, in setUp
    self.tester = SyncreplClient(
                  ^^^^^^^^^^^^^^^
  File "/home/ncopa/aports/community/py3-ldap/src/python-ldap-python-ldap-3.4.4/Tests/t_ldap_syncrepl.py", line 165, in __init__
    self.simple_bind_s(dn, password)
  File "/home/ncopa/aports/community/py3-ldap/src/python-ldap-python-ldap-3.4.4/Lib/ldap/ldapobject.py", line 249, in simple_bind_s
    resp_type, resp_data, resp_msgid, resp_ctrls = self.result3(msgid,all=1,timeout=self.timeout)
                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ncopa/aports/community/py3-ldap/src/python-ldap-python-ldap-3.4.4/Lib/ldap/ldapobject.py", line 543, in result3
    resp_type, resp_data, resp_msgid, decoded_resp_ctrls, retoid, retval = self.result4(
                                                                           ^^^^^^^^^^^^^
  File "/home/ncopa/aports/community/py3-ldap/src/python-ldap-python-ldap-3.4.4/Lib/ldap/ldapobject.py", line 553, in result4
    ldap_result = self._ldap_call(self._l.result4,msgid,all,timeout,add_ctrls,add_intermediates,add_extop)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ncopa/aports/community/py3-ldap/src/python-ldap-python-ldap-3.4.4/Lib/ldap/ldapobject.py", line 128, in _ldap_call
    result = func(*args,**kwargs)
             ^^^^^^^^^^^^^^^^^^^^
ldap.SERVER_DOWN: {'result': -1, 'desc': "Can't contact LDAP server", 'errno': 104, 'ctrls': [], 'info': 'Connection reset by peer'}

======================================================================
ERROR: test_refreshAndPersist_search (Tests.t_ldap_syncrepl.TestSyncrepl.test_refreshAndPersist_search)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ncopa/aports/community/py3-ldap/src/python-ldap-python-ldap-3.4.4/Tests/t_ldap_syncrepl.py", line 436, in setUp
    self.tester = SyncreplClient(
                  ^^^^^^^^^^^^^^^
  File "/home/ncopa/aports/community/py3-ldap/src/python-ldap-python-ldap-3.4.4/Tests/t_ldap_syncrepl.py", line 165, in __init__
    self.simple_bind_s(dn, password)
  File "/home/ncopa/aports/community/py3-ldap/src/python-ldap-python-ldap-3.4.4/Lib/ldap/ldapobject.py", line 248, in simple_bind_s
    msgid = self.simple_bind(who,cred,serverctrls,clientctrls)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ncopa/aports/community/py3-ldap/src/python-ldap-python-ldap-3.4.4/Lib/ldap/ldapobject.py", line 242, in simple_bind
    return self._ldap_call(self._l.simple_bind,who,cred,RequestControlTuples(serverctrls),RequestControlTuples(clientctrls))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ncopa/aports/community/py3-ldap/src/python-ldap-python-ldap-3.4.4/Lib/ldap/ldapobject.py", line 128, in _ldap_call
    result = func(*args,**kwargs)
             ^^^^^^^^^^^^^^^^^^^^
ldap.SERVER_DOWN: {'result': -1, 'desc': "Can't contact LDAP server", 'errno': 107, 'ctrls': [], 'info': 'Socket not connected'}

======================================================================
ERROR: test_refreshAndPersist_timeout (Tests.t_ldap_syncrepl.TestSyncrepl.test_refreshAndPersist_timeout)
Make sure refreshAndPersist can handle a search with timeouts.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ncopa/aports/community/py3-ldap/src/python-ldap-python-ldap-3.4.4/Tests/t_ldap_syncrepl.py", line 436, in setUp
    self.tester = SyncreplClient(
                  ^^^^^^^^^^^^^^^
  File "/home/ncopa/aports/community/py3-ldap/src/python-ldap-python-ldap-3.4.4/Tests/t_ldap_syncrepl.py", line 165, in __init__
    self.simple_bind_s(dn, password)
  File "/home/ncopa/aports/community/py3-ldap/src/python-ldap-python-ldap-3.4.4/Lib/ldap/ldapobject.py", line 248, in simple_bind_s
    msgid = self.simple_bind(who,cred,serverctrls,clientctrls)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ncopa/aports/community/py3-ldap/src/python-ldap-python-ldap-3.4.4/Lib/ldap/ldapobject.py", line 242, in simple_bind
    return self._ldap_call(self._l.simple_bind,who,cred,RequestControlTuples(serverctrls),RequestControlTuples(clientctrls))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ncopa/aports/community/py3-ldap/src/python-ldap-python-ldap-3.4.4/Lib/ldap/ldapobject.py", line 128, in _ldap_call
    result = func(*args,**kwargs)
             ^^^^^^^^^^^^^^^^^^^^
ldap.SERVER_DOWN: {'result': -1, 'desc': "Can't contact LDAP server", 'errno': 107, 'ctrls': [], 'info': 'Socket not connected'}

======================================================================
ERROR: test_refreshOnly_poll_full (Tests.t_ldap_syncrepl.TestSyncrepl.test_refreshOnly_poll_full)
Test doing a full refresh cycle, and check what we got.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ncopa/aports/community/py3-ldap/src/python-ldap-python-ldap-3.4.4/Tests/t_ldap_syncrepl.py", line 436, in setUp
    self.tester = SyncreplClient(
                  ^^^^^^^^^^^^^^^
  File "/home/ncopa/aports/community/py3-ldap/src/python-ldap-python-ldap-3.4.4/Tests/t_ldap_syncrepl.py", line 165, in __init__
    self.simple_bind_s(dn, password)
  File "/home/ncopa/aports/community/py3-ldap/src/python-ldap-python-ldap-3.4.4/Lib/ldap/ldapobject.py", line 248, in simple_bind_s
    msgid = self.simple_bind(who,cred,serverctrls,clientctrls)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ncopa/aports/community/py3-ldap/src/python-ldap-python-ldap-3.4.4/Lib/ldap/ldapobject.py", line 242, in simple_bind
    return self._ldap_call(self._l.simple_bind,who,cred,RequestControlTuples(serverctrls),RequestControlTuples(clientctrls))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ncopa/aports/community/py3-ldap/src/python-ldap-python-ldap-3.4.4/Lib/ldap/ldapobject.py", line 128, in _ldap_call
    result = func(*args,**kwargs)
             ^^^^^^^^^^^^^^^^^^^^
ldap.SERVER_DOWN: {'result': -1, 'desc': "Can't contact LDAP server", 'errno': 107, 'ctrls': [], 'info': 'Socket not connected'}

======================================================================
ERROR: test_refreshOnly_search (Tests.t_ldap_syncrepl.TestSyncrepl.test_refreshOnly_search)
Test to see if we can initialize a syncrepl search.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ncopa/aports/community/py3-ldap/src/python-ldap-python-ldap-3.4.4/Tests/t_ldap_syncrepl.py", line 436, in setUp
    self.tester = SyncreplClient(
                  ^^^^^^^^^^^^^^^
  File "/home/ncopa/aports/community/py3-ldap/src/python-ldap-python-ldap-3.4.4/Tests/t_ldap_syncrepl.py", line 165, in __init__
    self.simple_bind_s(dn, password)
  File "/home/ncopa/aports/community/py3-ldap/src/python-ldap-python-ldap-3.4.4/Lib/ldap/ldapobject.py", line 248, in simple_bind_s
    msgid = self.simple_bind(who,cred,serverctrls,clientctrls)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ncopa/aports/community/py3-ldap/src/python-ldap-python-ldap-3.4.4/Lib/ldap/ldapobject.py", line 242, in simple_bind
    return self._ldap_call(self._l.simple_bind,who,cred,RequestControlTuples(serverctrls),RequestControlTuples(clientctrls))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ncopa/aports/community/py3-ldap/src/python-ldap-python-ldap-3.4.4/Lib/ldap/ldapobject.py", line 128, in _ldap_call
    result = func(*args,**kwargs)
             ^^^^^^^^^^^^^^^^^^^^
ldap.SERVER_DOWN: {'result': -1, 'desc': "Can't contact LDAP server", 'errno': 107, 'ctrls': [], 'info': 'Socket not connected'}

----------------------------------------------------------------------
Ran 253 tests in 7.315s

FAILED (errors=5, skipped=1, expected failures=3)
Test failed: <unittest.runner.TextTestResult run=253 errors=5 failures=0>
error: Test failed: <unittest.runner.TextTestResult run=253 errors=5 failures=0>

Steps to reproduce:

python3 setup.py build
python3 setup.py test

Operating system: Alpine Linux edge (x86_64)

Python version: 3.12.2

python-ldap version: 3.4.4

@ncopa
Copy link
Author

ncopa commented Mar 28, 2024

I think it may have to do with the setup or teardown of the test slapd server. Maybe a timing issue.

If I run the failing tests individually, they will pass:

$ PYTHONPATH=./build/lib.linux-x86_64-cpython
-312/ python -m unittest discover -v -s Tests -p 't_*' -k 't_ldap_syncrepl.TestSyncrepl.test_refreshAndPersist_search'
test_refreshAndPersist_search (t_ldap_syncrepl.TestSyncrepl.test_refreshAndPersist_search) ... ok

----------------------------------------------------------------------
Ran 1 test in 0.298s

OK

@ncopa
Copy link
Author

ncopa commented Mar 28, 2024

skipping Tests.t_ldap_syncrepl.TestSyncrepl.test_refreshAndPersist_cancelled makes the rest of the tests work. I think this test is broken and leaves things in a broken state causing the rest of the tests to fail

algitbot pushed a commit to alpinelinux/aports that referenced this issue Apr 12, 2024
@mistotebe
Copy link
Contributor

Nothing about the test looks broken in a related way. Somehow the connection (self.tester) was closed or ldap server stopped, you'll need to see which and why.

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