diff mbox series

[v2] glib-2.0: skip a timing sensitive monotonic-time ptest

Message ID 20260812072101.10905-1-pratik.farkase@est.tech
State Accepted, archived
Commit 8be25fcc6aeda62cabc126b2a4d9322c81776256
Headers show
Series [v2] glib-2.0: skip a timing sensitive monotonic-time ptest | expand

Commit Message

Pratik Farkase Aug. 12, 2026, 7:21 a.m. UTC
The /monotonic-time-ns/similar test compares g_get_monotonic_time() and
g_get_monotonic_time_ns() by spinning until the microsecond clock ticks
and asserting the two clocks haven't diverged. This is inherently racy
under QEMU emulation on loaded hosts, as the process can be preempted
between the clock reads.

[YOCTO #16230]

Signed-off-by: Pratik Farkase <pratik.farkase@est.tech>
---
 .../files/skip-monotonic-time-similar.patch   | 32 +++++++++++++++++++
 meta/recipes-core/glib-2.0/glib.inc           |  1 +
 2 files changed, 33 insertions(+)
 create mode 100644 meta/recipes-core/glib-2.0/files/skip-monotonic-time-similar.patch
diff mbox series

Patch

diff --git a/meta/recipes-core/glib-2.0/files/skip-monotonic-time-similar.patch b/meta/recipes-core/glib-2.0/files/skip-monotonic-time-similar.patch
new file mode 100644
index 0000000000..86087d3008
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/files/skip-monotonic-time-similar.patch
@@ -0,0 +1,32 @@ 
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Pratik Farkase <pratik.farkase@est.tech>
+Date: Tue, 5 Aug 2026 08:00:00 +0000
+Subject: [PATCH] Skip /monotonic-time-ns/similar test
+
+The test_similar test compares g_get_monotonic_time() and
+g_get_monotonic_time_ns() by spinning until the microsecond clock ticks
+and then asserting the two clocks haven't diverged beyond a factor of
+50. This is inherently racy under QEMU emulation on loaded hosts: the
+process can be preempted between the two clock reads, causing the
+assertion "50 * ns_elapsed > 1000 * us_elapsed" to fail.
+
+https://bugzilla.yoctoproject.org/show_bug.cgi?id=16230
+
+Upstream-Status: Inappropriate [upstream ticket: https://gitlab.gnome.org/GNOME/glib/-/work_items/4025]
+Signed-off-by: Pratik Farkase <pratik.farkase@est.tech>
+---
+ glib/tests/monotonic-time.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/glib/tests/monotonic-time.c b/glib/tests/monotonic-time.c
+index 04ff898..dae0533 100644
+--- a/glib/tests/monotonic-time.c
++++ b/glib/tests/monotonic-time.c
+@@ -153,7 +153,6 @@ main (int argc, char *argv[])
+   g_test_add_func ("/monotonic-time-ns/increasing", test_increasing_ns);
+   g_test_add_func ("/monotonic-time/usleep", test_usleep);
+   g_test_add_func ("/monotonic-time-ns/usleep", test_usleep_ns);
+-  g_test_add_func ("/monotonic-time-ns/similar", test_similar);
+ 
+   return g_test_run ();
+ }
diff --git a/meta/recipes-core/glib-2.0/glib.inc b/meta/recipes-core/glib-2.0/glib.inc
index f554145bb0..903d56e05f 100644
--- a/meta/recipes-core/glib-2.0/glib.inc
+++ b/meta/recipes-core/glib-2.0/glib.inc
@@ -235,6 +235,7 @@  SRC_URI += "\
            file://0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch \
            file://0010-Do-not-hardcode-python-path-into-various-tools.patch \
            file://skip-timeout.patch \
+           file://skip-monotonic-time-similar.patch \
            file://CVE-2026-58016-1.patch \
            file://CVE-2026-58016-2.patch \
            file://0001-gio-tests-services-Fix-installed-service-file-using-.patch \