From patchwork Sat Dec 5 08:05:24 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 107505 Received: from mail-dl1-f52.google.com (mail-dl1-f52.google.com [74.125.82.52]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.2561.1796457927367672244 for ; Sat, 05 Dec 2026 00:05:27 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=ssFNlBuR; spf=pass (domain: gmail.com, ip: 74.125.82.52, mailfrom: raj.khem@gmail.com) Received: by mail-dl1-f52.google.com with SMTP id a92af1059eb24-15ea896ddc8so2261180c88.0 for ; Sat, 05 Dec 2026 00:05:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796457926; x=1797062726; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=vQM19T+ONjdKPji9H3c2/kjf5U8Zwauf668Hj0RHqjQ=; b=ssFNlBuR9LIzA+ib0gCq5SpopJGExoeH580yKfU/wQkQ+eOYXCoughjIR1B11Pc5AZ IUTxVACyWCmZzW6jnVozQXvSKIMalxMF2EZvHOOroqmnOTnCO4dtOxOqqCqGDJqf9fW9 67zkMaVTFjP3B9745ezdAYZgeV9ssBaxdPotHJI7oRvSvzgFnYmyEH6daXW6qJ4bKMGg 9VOWPI7XhXMWCrnoJcM/WHbAXsZn3Wg/04z/p+zd6qTKibXPNWsSOeZUT/2e+sKlV2Sb TyxqcS5F6saYfkPchYo+x4Xr5qg6YIfoB2qakfos7wjCWNo/LvQDGDUSYFT0afIKgmtO HIGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796457926; x=1797062726; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:c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fMNo9Uu1kUkpG QvRm/VeFIGgGmjGzZwacq+GZvZEUQrWjp3hkQSW9C6g3TUAydg0sfjeR5j0T0jM4PAC/wwacNhh LXKVeDLkOK/4uKHQ+pNmFNcvFohC7QGnDdgwE/rceYeoabjUMlB9vpxJSujzG36Iq6k21bbpmyF hRWLTnzl1W62VsKs7twv4A0KdESse6VyV9JC1L8GLTEZYAfc6k8Z2YQU8XWSnuDGJaoLlO7NO89 67Zi6YCfcnEb3namL5MRFSgQ5GnOt87F0IQq9Yg7OOtbI+4zpFmJtrJHruupKf3LFtTbv+44JzP J4NjLuTwFSy1M5hok2rsUZJBkdHiFKGhJZlSfLX/b/AsDi39WW3Vs0kbO8B7WqF8my1NfPaIF0I oyqL X-Received: by 2002:a05:7300:83:b0:387:50d8:f9aa with SMTP id 5a478bee46e88-387521d80e3mr4271627eec.37.1796457925853; Sat, 05 Dec 2026 00:05:25 -0800 (PST) Return-Path: Received: from apollo.tail3ccdd3.ts.net ([147.160.63.35]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3875218c602sm22245371eec.7.2026.12.05.00.05.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Dec 2026 00:05:25 -0800 (PST) From: Khem Raj X-Google-Original-From: Khem Raj To: openembedded-devel@lists.openembedded.org Cc: Khem Raj Subject: [meta-python][PATCH] python3-yappi: Fix a flaky gevent ptest Date: Sat, 5 Dec 2026 00:05:24 -0800 Message-ID: <20261205080524.1026093-1-khem.raj@oss.qualcomm.com> X-Mailer: git-send-email 2.56.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Sat, 05 Dec 2026 08:05:29 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/134110 test_context_cbks_reset_to_default expects the worker thread, which burns 50ms of CPU, to sort before the main thread by total time. On a loaded QEMU guest the main thread can use more than that while gevent creates its hub, which swaps the order and fails the test. Look the stats up by thread id instead. Signed-off-by: Khem Raj --- ...ts-Look-up-thread-stats-by-thread-id.patch | 49 +++++++++++++++++++ .../python/python3-yappi_1.7.7.bb | 1 + 2 files changed, 50 insertions(+) create mode 100644 meta-python/recipes-devtools/python/python3-yappi/0004-tests-Look-up-thread-stats-by-thread-id.patch diff --git a/meta-python/recipes-devtools/python/python3-yappi/0004-tests-Look-up-thread-stats-by-thread-id.patch b/meta-python/recipes-devtools/python/python3-yappi/0004-tests-Look-up-thread-stats-by-thread-id.patch new file mode 100644 index 0000000000..ef45a724e6 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-yappi/0004-tests-Look-up-thread-stats-by-thread-id.patch @@ -0,0 +1,49 @@ +From 11b7485d904da0fe2c5f3dc9bc71285a99b57f05 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 4 Dec 2026 18:30:56 -0800 +Subject: [PATCH] tests: Look up thread stats by thread id in + test_context_cbks_reset_to_default + +The test assumed ThreadA, which burns 50ms of CPU, sorts before the main +thread by ttot. The main thread also accumulates CPU time while gevent +creates its hub for the greenlet, and on a slow or loaded machine (e.g. +a QEMU guest) that can exceed 50ms, swapping the order: + + AssertionError: 140529029749696 != 140528074962624 + +Match the stats to threads by tid instead of relying on the sort order. + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + tests/test_gevent.py | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/tests/test_gevent.py b/tests/test_gevent.py +index ed9e6ae..882d51a 100644 +--- a/tests/test_gevent.py ++++ b/tests/test_gevent.py +@@ -151,13 +151,18 @@ class TestAPI(GeventTest): + len(tstats), 2, "Incorrect number of contexts captured" + ) + +- # First stat should be of threadA since it is sorted by ttot +- statsA = tstats[0] ++ # Look the stats up by thread id: the main thread can use more CPU ++ # than threadA (e.g. while gevent creates its hub), so the ttot ++ # order is not fixed. ++ stats = {s.tid: s for s in tstats} ++ main_thread = threading.current_thread() ++ self.assertEqual(set(stats), {t.ident, main_thread.ident}) ++ ++ statsA = stats[t.ident] + self.assertEqual(statsA.tid, t.ident) + self.assertEqual(statsA.name, t.__class__.__name__) + +- statsMain = tstats[1] +- main_thread = threading.current_thread() ++ statsMain = stats[main_thread.ident] + self.assertEqual(statsMain.tid, main_thread.ident) + self.assertEqual(statsMain.name, main_thread.__class__.__name__) + diff --git a/meta-python/recipes-devtools/python/python3-yappi_1.7.7.bb b/meta-python/recipes-devtools/python/python3-yappi_1.7.7.bb index 9a0a38b9bc..8c4546fe76 100644 --- a/meta-python/recipes-devtools/python/python3-yappi_1.7.7.bb +++ b/meta-python/recipes-devtools/python/python3-yappi_1.7.7.bb @@ -8,6 +8,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=71c208c9a4fd864385eb69ad4caa3bee" SRC_URI = "git://github.com/sumerc/yappi.git;protocol=https;branch=master;tag=v${PV} \ file://0002-Fix-import-of-tests.utils-to-enable-pytest.patch \ file://0003-Detect-suspended-coroutines-on-Python-3.15-and-newer.patch \ + file://0004-tests-Look-up-thread-stats-by-thread-id.patch \ " SRCREV = "d6593ea0bce0a13c65bd44511c3cee858b5985e8" UPSTREAM_CHECK_GITTAGREGEX = "^v(?P\d+(\.\d+)+)$"