Re: [PATCH libevl] tests: skip sched-tp-overrun in virtual environments

Philippe Gerum <[email protected]> Thu, 09 Jul 2026 15:34:24 +0200
Newsgroups dev.linux.lists.xenomai
Message-ID <[email protected]>
Tobias Schaffner <[email protected]> writes:

> 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 <[email protected]>
> ---
>  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);

Merged, thanks.

-- 
Philippe.