All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH libevl] tests: skip sched-tp-overrun in virtual environments
@ 2026-07-09 12:58 Tobias Schaffner
  2026-07-09 13:34 ` Philippe Gerum
  0 siblings, 1 reply; 2+ messages in thread
From: Tobias Schaffner @ 2026-07-09 12:58 UTC (permalink / raw)
  To: xenomai; +Cc: rpm, jan.kiszka, Tobias Schaffner

Do not try to relax sched-tp-overrun on virtualized environments
but skip the whole test since the test relies on timing guarantees
that are not reliable under virtualization and further relaxations
do not make any sense.

Signed-off-by: Tobias Schaffner <tobias.schaffner@siemens.com>
---
 tests/sched-tp-overrun.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/tests/sched-tp-overrun.c b/tests/sched-tp-overrun.c
index 3bb6a21..a3ef27f 100644
--- a/tests/sched-tp-overrun.c
+++ b/tests/sched-tp-overrun.c
@@ -128,16 +128,9 @@ static void *tp_thread(void *arg)
 	 */
 	__Texpr_assert(nf.event.val == part * 2);
 
-	/*
-	 * Perform the following check on real hardware only, it is
-	 * likely to be wrong in a virtualized environment for timing
-	 * accuracy reason.
-	 */
-	if (!running_on_vm()) {
-		/* Check that a single notification was sent. */
-		__Fcall_assert(ret, evl_read_observable(tfd, &nf, 1));
-		__Texpr_assert(ret == -EAGAIN);
-	}
+	/* Check that a single notification was sent. */
+	__Fcall_assert(ret, evl_read_observable(tfd, &nf, 1));
+	__Texpr_assert(ret == -EAGAIN);
 
 	return NULL;
 }
@@ -177,6 +170,15 @@ int main(int argc, char *argv[])
 		return 1;
 	}
 
+	/*
+	 * Skip on virtualized environments since the test relies on
+	 * timing guarantees that are not reliable under virtualization.
+	 */
+	if (running_on_vm()) {
+		emit_info("unchecked (vm)");
+		return EXIT_NO_STATUS;
+	}
+
 	param.sched_priority = HIGH_PRIO;
 	__Texpr_assert(pthread_setschedparam(pthread_self(),
 				SCHED_FIFO, &param) == 0);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-09 13:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-09 12:58 [PATCH libevl] tests: skip sched-tp-overrun in virtual environments Tobias Schaffner
2026-07-09 13:34 ` Philippe Gerum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.