diff mbox

[i-g-t,2/2] lib: use test failure status for igt_set_timeout

Message ID 1428578069-8698-2-git-send-email-thomas.wood@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Thomas Wood April 9, 2015, 11:14 a.m. UTC
Use a failure status code for timeout to avoid confusion between tests
that take too long to execute versus a failure due to an operation
taking longer than expected.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
---
 lib/igt_core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Daniel Vetter April 9, 2015, 12:27 p.m. UTC | #1
On Thu, Apr 09, 2015 at 12:14:29PM +0100, Thomas Wood wrote:
> Use a failure status code for timeout to avoid confusion between tests
> that take too long to execute versus a failure due to an operation
> taking longer than expected.
> 
> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
> ---
>  lib/igt_core.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index f9e92c9..e5bda86 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -1705,15 +1705,15 @@ out:
>  
>  static void igt_alarm_handler(int signal)
>  {
> -	/* exit with timeout status */
> -	igt_fail(IGT_EXIT_TIMEOUT);
> +	/* exit with failure status */
> +	igt_fail(IGT_EXIT_FAILURE);

I think an igt_info("timed out\n"); right above might be useful. lgtm
otherwise for both patches.
-Daniel

>  }
>  
>  /**
>   * igt_set_timeout:
>   * @seconds: number of seconds before timeout
>   *
> - * Fail a test and exit with #IGT_EXIT_TIMEOUT status after the specified
> + * Fail a test and exit with #IGT_EXIT_FAILURE 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.
> -- 
> 2.1.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/lib/igt_core.c b/lib/igt_core.c
index f9e92c9..e5bda86 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -1705,15 +1705,15 @@  out:
 
 static void igt_alarm_handler(int signal)
 {
-	/* exit with timeout status */
-	igt_fail(IGT_EXIT_TIMEOUT);
+	/* exit with failure status */
+	igt_fail(IGT_EXIT_FAILURE);
 }
 
 /**
  * igt_set_timeout:
  * @seconds: number of seconds before timeout
  *
- * Fail a test and exit with #IGT_EXIT_TIMEOUT status after the specified
+ * Fail a test and exit with #IGT_EXIT_FAILURE 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.