diff mbox series

[meta-oe,6/8] tbb: Skip test_resumable_tasks in ptest under QEMU

Message ID 20261026035814.55254-6-khem.raj@oss.qualcomm.com
State New
Headers show
Series [meta-python,1/8] python3-ipy: upgrade 1.01 -> 1.2 | expand

Commit Message

Khem Raj Oct. 26, 2026, 3:58 a.m. UTC
test_resumable_tasks suspends and resumes tasks about 6 million times.
On qemuriscv64 it passes but takes ~790s without printing anything, so
ptest-runner hits its 450s timeout and kills the whole suite after 28
tests.

Skip it when running under QEMU, detected at runtime via DMI sys_vendor,
a fw-cfg device tree node or a qemu device tree compatible, so real
hardware still runs it. With that, all other 140 tests pass on
qemuriscv64.

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
 meta-oe/recipes-support/tbb/files/run-ptest | 23 ++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/meta-oe/recipes-support/tbb/files/run-ptest b/meta-oe/recipes-support/tbb/files/run-ptest
index ef14dab437..d5ca892150 100755
--- a/meta-oe/recipes-support/tbb/files/run-ptest
+++ b/meta-oe/recipes-support/tbb/files/run-ptest
@@ -1,10 +1,27 @@ 
 #!/bin/sh

-# ctest result lines look like: "  1/142 Test   #1: test_tick_count .....   Passed    0.01 sec"
-# anything other than Passed/Skipped/Disabled (Failed, Timeout, Exception, Not Run) is a FAIL
+# Running under QEMU (x86 and UEFI arm64 report it via DMI, arm/arm64/riscv
+# virt machines have a fw-cfg node, ppc64 pseries a qemu compatible)
+is_qemu() {
+    [ "$(cat /sys/class/dmi/id/sys_vendor 2>/dev/null)" = "QEMU" ] && return 0
+    for f in /proc/device-tree/fw-cfg@*; do
+        [ -e "$f" ] && return 0
+    done
+    grep -qs qemu /proc/device-tree/compatible
+}
+
 # test_scheduler_mix hangs intermittently on every architecture
 # https://github.com/uxlfoundation/oneTBB/issues/1281
-ctest -E '^test_scheduler_mix$' | awk '/Test +#[0-9]+:/ {
+SKIP='test_scheduler_mix'
+# test_resumable_tasks switches fibers ~6 million times; emulated, it runs
+# silently for longer than the ptest-runner timeout (~790s on qemuriscv64)
+if is_qemu; then
+    SKIP="$SKIP|test_resumable_tasks"
+fi
+
+# ctest result lines look like: "  1/142 Test   #1: test_tick_count .....   Passed    0.01 sec"
+# anything other than Passed/Skipped/Disabled (Failed, Timeout, Exception, Not Run) is a FAIL
+ctest -E "^($SKIP)\$" | awk '/Test +#[0-9]+:/ {
     if ($0 ~ /Passed/) res = "PASS"
     else if ($0 ~ /Skipped|Disabled/) res = "SKIP"
     else res = "FAIL"