[igt-dev] [PATCH i-g-t 1/1] lib: Make igt_set_timeout fail with a timeout status

Antonio Argenziano antonio.argenziano at intel.com
Tue Apr 17 14:39:46 UTC 2018



On 17/04/18 07:26, Petri Latvala wrote:
> A timeout failure seems exactly what IGT_EXIT_TIMEOUT is for.
> 
> Also make the failure error message be printed with critical log level
> to match what's done for __igt_fail_assert's message.
> 
> Signed-off-by: Petri Latvala <petri.latvala at intel.com>

Acked-by: Antonio Argenziano <antonio.argenziano at intel.com>

> ---
>   lib/igt_core.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 5092a3f0..af36fef9 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -2143,12 +2143,12 @@ static const char *timeout_op;
>   static void __attribute__((noreturn)) igt_alarm_handler(int signal)
>   {
>   	if (timeout_op)
> -		igt_info("Timed out: %s\n", timeout_op);
> +		igt_critical("Timed out: %s\n", timeout_op);
>   	else
> -		igt_info("Timed out\n");
> +		igt_critical("Timed out\n");
>   
>   	/* exit with failure status */
> -	igt_fail(IGT_EXIT_FAILURE);
> +	igt_fail(IGT_EXIT_TIMEOUT);
>   }
>   
>   /**
> @@ -2156,7 +2156,7 @@ static void __attribute__((noreturn)) igt_alarm_handler(int signal)
>    * @seconds: number of seconds before timeout
>    * @op: Optional string to explain what operation has timed out in the debug log
>    *
> - * Fail a test and exit with #IGT_EXIT_FAILURE status after the specified
> + * Fail a test and exit with #IGT_EXIT_TIMEOUT status after the specified
>    * number of seconds have elapsed. If the current test has subtests and the
>    * timeout occurs outside a subtest, subsequent subtests will be skipped and
>    * marked as failed.
> 


More information about the igt-dev mailing list