diff mbox series

[2/5] python3-uvloop: enable ptest

Message ID 20261102011816.3710992-2-tim.orling@konsulko.com
State Under Review
Headers show
Series [1/5] python3-uvloop: import 0.22.1 from meta-homeassistant | expand

Commit Message

Tim Orling Nov. 2, 2026, 1:18 a.m. UTC
From: Tim Orling <tim.orling@konsulko.com>

The sdist ships the test suite. run-ptest deselects:
* tests that conflict with pytest's output capture;
* tests broken by libuv 1.53.0 spawning with posix_spawn() on Linux,
  which bypasses uvloop's preexec_fn fork hook;
* DNS tests that wait for resolver timeouts without network access,
  which took the suite from 1 to 10 minutes over tap without NAT.

.flake8 and mypy.ini let test_sourcecode skip cleanly when flake8 and
mypy are missing.

Tested with core-image-ptest-python3-uvloop on qemux86-64 (kvm, tap):
455 passed, 35 skipped, 0 failed in 82s, so add it to PTESTS_SLOW.

AI-Generated: Uses Claude Code (Claude Opus 5.5)
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
 .../distro/include/ptest-packagelists.inc     |  1 +
 .../python/python3-uvloop/run-ptest           | 25 +++++++++++++++++
 .../python/python3-uvloop_0.22.1.bb           | 27 +++++++++++++++++--
 3 files changed, 51 insertions(+), 2 deletions(-)
 create mode 100755 meta/recipes-devtools/python/python3-uvloop/run-ptest

Comments

patchtest@automation.yoctoproject.org Nov. 2, 2026, 1:33 a.m. UTC | #1
Thank you for your submission. Patchtest identified one
or more issues with the patch. Please see the log below for
more information:

---
Testing patch /home/patchtest/share/mboxes/2-5-python3-uvloop-enable-ptest.patch

FAIL: test max line length: Patch line too long (current length 333, maximum is 200) (test_metadata.TestMetadata.test_max_line_length)

PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test auh changelog truncation notice (test_mbox.TestMbox.test_auh_changelog_truncation_notice)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)

SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: pretest src uri left files: Patch cannot be merged (test_metadata.TestMetadata.pretest_src_uri_left_files)
SKIP: test CVE check ignore: No modified recipes or older target branch, skipping test (test_metadata.TestMetadata.test_cve_check_ignore)
SKIP: test CVE tag format: No new source patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new source patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new source patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum modified not mentioned: No modified recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test src uri left files: Patch cannot be merged (test_metadata.TestMetadata.test_src_uri_left_files)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this
email with an explanation of why the patch should be accepted. If you
believe these results are due to an error in patchtest, please submit a
bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category
under 'Yocto Project Subprojects'). For more information on specific
failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank
you!
diff mbox series

Patch

diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index bef45bb4d5..50b971bace 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -154,6 +154,7 @@  PTESTS_SLOW = "\
     python3-click \
     python3-cryptography \
     python3-numpy \
+    python3-uvloop \
     python3-xmltodict \
     strace \
     tar \
diff --git a/meta/recipes-devtools/python/python3-uvloop/run-ptest b/meta/recipes-devtools/python/python3-uvloop/run-ptest
new file mode 100755
index 0000000000..db86664f9a
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-uvloop/run-ptest
@@ -0,0 +1,25 @@ 
+#!/bin/sh
+# test_process_streams_redirect: replaces the stdout/stderr fds, which
+# conflicts with pytest's output capture.
+# test_process_preexec_fn_{1,2}, Test_UV_DNS test_getaddrinfo_{8,9}: libuv
+# 1.53.0 spawns with posix_spawn(), so preexec_fn never runs, and an empty
+# host gives EAI_NODATA.
+# test_getaddrinfo_{1,2,3,5,6,11}, Test_AIO_DNS test_getaddrinfo_{8,9}: each
+# DNS lookup waits for the resolver timeout without network access.
+# --deselect matches a node id prefix, so -k handles 1, 2 and 11.
+pytest --automake \
+    -k "not (test_getaddrinfo_1 or test_getaddrinfo_2) or test_getaddrinfo_10 or test_getaddrinfo_12 or test_getaddrinfo_13 or test_getaddrinfo_14 or test_getaddrinfo_15 or test_getaddrinfo_16 or test_getaddrinfo_17 or test_getaddrinfo_18 or test_getaddrinfo_19 or test_getaddrinfo_20 or test_getaddrinfo_21 or test_getaddrinfo_22" \
+    --deselect=tests/test_process.py::Test_UV_Process::test_process_streams_redirect \
+    --deselect=tests/test_process.py::Test_AIO_Process::test_process_streams_redirect \
+    --deselect=tests/test_process.py::Test_UV_Process::test_process_preexec_fn_1 \
+    --deselect=tests/test_process.py::Test_UV_Process::test_process_preexec_fn_2 \
+    --deselect=tests/test_dns.py::Test_UV_DNS::test_getaddrinfo_3 \
+    --deselect=tests/test_dns.py::Test_UV_DNS::test_getaddrinfo_5 \
+    --deselect=tests/test_dns.py::Test_UV_DNS::test_getaddrinfo_6 \
+    --deselect=tests/test_dns.py::Test_UV_DNS::test_getaddrinfo_8 \
+    --deselect=tests/test_dns.py::Test_UV_DNS::test_getaddrinfo_9 \
+    --deselect=tests/test_dns.py::Test_AIO_DNS::test_getaddrinfo_3 \
+    --deselect=tests/test_dns.py::Test_AIO_DNS::test_getaddrinfo_5 \
+    --deselect=tests/test_dns.py::Test_AIO_DNS::test_getaddrinfo_6 \
+    --deselect=tests/test_dns.py::Test_AIO_DNS::test_getaddrinfo_8 \
+    --deselect=tests/test_dns.py::Test_AIO_DNS::test_getaddrinfo_9
diff --git a/meta/recipes-devtools/python/python3-uvloop_0.22.1.bb b/meta/recipes-devtools/python/python3-uvloop_0.22.1.bb
index 887c262ae7..39b6a2602a 100644
--- a/meta/recipes-devtools/python/python3-uvloop_0.22.1.bb
+++ b/meta/recipes-devtools/python/python3-uvloop_0.22.1.bb
@@ -7,11 +7,34 @@  LIC_FILES_CHKSUM = "file://LICENSE-APACHE;md5=bb92739ddad0a2811957bd98bdb90474 \
 
 DEPENDS += "libuv python3-wheel-native"
 
-SRC_URI += "file://0001-setup.cfg-use-system-libuv.patch"
+SRC_URI += "\
+    file://0001-setup.cfg-use-system-libuv.patch \
+    file://run-ptest \
+"
 SRC_URI[sha256sum] = "6c84bae345b9147082b17371e3dd5d42775bddce91f885499017f4607fdaf39f"
 
-inherit pypi python_setuptools_build_meta cython
+inherit pypi python_setuptools_build_meta cython ptest-python-pytest
 
 RDEPENDS:${PN} = "python3-asyncio"
 
+RDEPENDS:${PN}-ptest += "\
+    python3-ctypes \
+    python3-io \
+    python3-logging \
+    python3-math \
+    python3-multiprocessing \
+    python3-netclient \
+    python3-numbers \
+    python3-pickle \
+    python3-pprint \
+    python3-psutil \
+    python3-pyopenssl \
+    python3-threading \
+"
+
+do_install_ptest:append() {
+    # test_sourcecode needs these to skip cleanly when flake8 and mypy are missing
+    install -m 0644 ${S}/.flake8 ${S}/mypy.ini ${D}${PTEST_PATH}/
+}
+
 BBCLASSEXTEND = "native nativesdk"