eclipse-paho/paho.mqtt.python

Regression from 3rd party deps. Test failures in CI (the "tox" workflow) due to Callback API v1 deprecation warnings, on Py 3.8-3.12 (Tox 4.23.2, Pytest 8.3.3). The tests pass on Py 3.7 (Tox 4.8.0, Pytest 7.4.4 )..

Opened this issue · 0 comments

The last run on this repo was 6 months ago. If nothing else, it would be good to run it again in this repo, alongside the scheduled Code Quality jobs.

The failures seem due to Deprecation warnings of the API v1, so maybe a new version of something interprets warnings as test failures.

Run tox -e py
py: install_deps> python -I -m pip install pytest pytest-cov
.pkg: install_requires> python -I -m pip install hatchling
.pkg: _optional_hooks> python /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/pyproject_api/_backend.py True hatchling.build
.pkg: get_requires_for_build_sdist> python /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/pyproject_api/_backend.py True hatchling.build
.pkg: freeze> python -m pip freeze --all
.pkg: hatchling==1.25.0,packaging==24.1,pathspec==0.12.1,pip==24.3.1,pluggy==1.5.0,trove-classifiers==2024.10.21.16
.pkg: build_sdist> python /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/pyproject_api/_backend.py True hatchling.build
py: install_package> python -I -m pip install --force-reinstall --no-deps /home/runner/work/paho.mqtt.python/paho.mqtt.python/.tox/.tmp/package/1/paho_mqtt-2.1.1.dev0.tar.gz
py: freeze> python -m pip freeze --all
py: coverage==7.6.4,iniconfig==2.0.0,packaging==24.1,paho-mqtt @ file:///home/runner/work/paho.mqtt.python/paho.mqtt.python/.tox/.tmp/package/1/paho_mqtt-2.1.1.dev0.tar.gz#sha256=8fd77bfaa222139f52d7f47e1dddbdb1ec5a61cfc1add5233d900c5d29d34398,pip==24.3.1,pluggy==1.5.0,pytest==8.3.3,pytest-cov==5.0.0
py: commands[0]> pytest --cov=. --cov=/home/runner/work/paho.mqtt.python/paho.mqtt.python/.tox/py/lib/python3.12/site-packages/paho
============================= test session starts ==============================
platform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0
cachedir: .tox/py/.pytest_cache
rootdir: /home/runner/work/paho.mqtt.python/paho.mqtt.python
configfile: pyproject.toml
testpaths: tests, src
plugins: cov-5.0.0
collected 163 items

tests/lib/test_01_asyncio.py .                                           [  0%]
tests/lib/test_01_decorators.py .                                        [  1%]
tests/lib/test_01_keepalive_pingreq.py .E                                [  1%]
tests/lib/test_01_no_clean_session.py .                                  [  2%]
tests/lib/test_01_reconnect_on_failure.py ..                             [  3%]
tests/lib/test_01_unpwd_empty_password_set.py .E                         [  4%]
tests/lib/test_01_unpwd_empty_set.py .E                                  [  4%]
tests/lib/test_01_unpwd_set.py .                                         [  5%]
tests/lib/test_01_unpwd_unicode_set.py .                                 [  6%]
tests/lib/test_01_will_set.py .                                          [  6%]
tests/lib/test_01_will_unpwd_set.py .                                    [  7%]
tests/lib/test_01_zero_length_clientid.py .                              [  7%]
tests/lib/test_02_subscribe_qos0.py .                                    [  8%]
tests/lib/test_02_subscribe_qos1.py .                                    [  9%]
tests/lib/test_02_subscribe_qos2.py .                                    [  9%]
tests/lib/test_02_unsubscribe.py .                                       [ 10%]
tests/lib/test_03_publish_b2c_qos1.py .                                  [ 11%]
tests/lib/test_03_publish_b2c_qos2.py .E                                 [ 11%]
tests/lib/test_03_publish_c2b_qos1_disconnect.py .                       [ 12%]
tests/lib/test_03_publish_c2b_qos2_disconnect.py .                       [ 12%]
tests/lib/test_03_publish_fill_inflight.py x                             [ 13%]
tests/lib/test_03_publish_helper_qos0.py .                               [ 14%]
tests/lib/test_03_publish_helper_qos0_v5.py .                            [ 14%]
tests/lib/test_03_publish_helper_qos1_disconnect.py .                    [ 15%]
tests/lib/test_03_publish_qos0.py .                                      [ 15%]
tests/lib/test_03_publish_qos0_no_payload.py .                           [ 16%]
tests/lib/test_04_retain_qos0.py .                                       [ 17%]
tests/lib/test_08_ssl_bad_cacert.py .                                    [ 17%]
tests/lib/test_08_ssl_connect_alpn.py .                                  [ 18%]
tests/lib/test_08_ssl_connect_cert_auth.py .                             [ 19%]
tests/lib/test_08_ssl_connect_cert_auth_pw.py .                          [ 19%]
tests/lib/test_08_ssl_connect_no_auth.py .                               [ 20%]
tests/lib/test_08_ssl_fake_cacert.py .                                   [ 20%]
tests/test_client.py ................................................... [ 52%]
...............                                                          [ 61%]
tests/test_matcher.py .................                                  [ 71%]
tests/test_mqttv5.py .....................                               [ 84%]
tests/test_reasoncodes.py ...                                            [ 86%]
tests/test_websocket_integration.py ..................                   [ 97%]
tests/test_websockets.py ....                                            [100%]

==================================== ERRORS ====================================
________________ ERROR at teardown of test_01_keepalive_pingreq ________________

    def fin():
        stop_process(proc)
        if proc.returncode != expected_returncode:
>           raise RuntimeError(f"Client {name} exited with code {proc.returncode}, expected {expected_returncode}")
E           RuntimeError: Client 01-keepalive-pingreq.py exited with code None, expected 0

tests/lib/conftest.py:75: RuntimeError
----------------------------- Captured stderr call -----------------------------
/home/runner/work/paho.mqtt.python/paho.mqtt.python/tests/lib/clients/01-keepalive-pingreq.py:10: DeprecationWarning: Callback API version 1 is deprecated, update to latest version
  mqttc = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1, "01-keepalive-pingreq")
____________ ERROR at teardown of test_01_unpwd_empty_password_set _____________

    def fin():
        stop_process(proc)
        if proc.returncode != expected_returncode:
>           raise RuntimeError(f"Client {name} exited with code {proc.returncode}, expected {expected_returncode}")
E           RuntimeError: Client 01-unpwd-empty-password-set.py exited with code None, expected 0

tests/lib/conftest.py:75: RuntimeError
----------------------------- Captured stderr call -----------------------------
/home/runner/work/paho.mqtt.python/paho.mqtt.python/tests/lib/clients/01-unpwd-empty-password-set.py:5: DeprecationWarning: Callback API version 1 is deprecated, update to latest version
  mqttc = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1, "01-unpwd-set")
_________________ ERROR at teardown of test_01_unpwd_empty_set _________________

    def fin():
        stop_process(proc)
        if proc.returncode != expected_returncode:
>           raise RuntimeError(f"Client {name} exited with code {proc.returncode}, expected {expected_returncode}")
E           RuntimeError: Client 01-unpwd-empty-set.py exited with code None, expected 0

tests/lib/conftest.py:75: RuntimeError
----------------------------- Captured stderr call -----------------------------
/home/runner/work/paho.mqtt.python/paho.mqtt.python/tests/lib/clients/01-unpwd-empty-set.py:5: DeprecationWarning: Callback API version 1 is deprecated, update to latest version
  mqttc = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1, "01-unpwd-set")
________________ ERROR at teardown of test_03_publish_b2c_qos2 _________________

    def fin():
        stop_process(proc)
        if proc.returncode != expected_returncode:
>           raise RuntimeError(f"Client {name} exited with code {proc.returncode}, expected {expected_returncode}")
E           RuntimeError: Client 03-publish-b2c-qos2.py exited with code None, expected 0

tests/lib/conftest.py:75: RuntimeError
----------------------------- Captured stderr call -----------------------------
/home/runner/work/paho.mqtt.python/paho.mqtt.python/tests/lib/clients/03-publish-b2c-qos2.py:22: DeprecationWarning: Callback API version 1 is deprecated, update to latest version
  mqttc = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1, "publish-qos2-test", clean_session=True)
DEBUG:paho.mqtt.client:Sending CONNECT (u0, p0, wr0, wq0, wf0, c1, k60) client_id=b'publish-qos2-test'
DEBUG:paho.mqtt.client:Received CONNACK (0, 0)
DEBUG:paho.mqtt.client:Received PUBLISH (d0, q2, r0, m13423), 'pub/qos2/receive', ...  (7 bytes)
DEBUG:paho.mqtt.client:Sending PUBREC (Mid: 13423)
DEBUG:paho.mqtt.client:Received PUBREL (Mid: 13423)
DEBUG:paho.mqtt.client:Sending PUBCOMP (Mid: 13423)

I can't approve workflows in this repo, but I've tried to run them in my fork (only the workflow files have been changed in the master branch, to run CI on all branches):
https://github.com/JamesParrott/paho.mqtt.python/actions/runs/11576577949/job/32225887766