[igt-dev] [PATCH i-g-t] runner: Fix graceful exit result parsing for dynamic subtests

Chris Wilson chris at chris-wilson.co.uk
Tue Jan 26 11:07:51 UTC 2021


Quoting Petri Latvala (2021-01-25 13:55:14)
> Commit 10c83dfa5ad2 ("runner: Introduce a way to stop testing without
> marking tests incomplete") added graceful exiting by signaling the
> runner with SIGHUP, marking the currently running test as 'notrun'
> instead of 'incomplete'. The result handling didn't handle dynamic
> subtests though, so the currently executing dynamic subtest was still
> marked as 'incomplete'. Handle that now similarly as handling the
> 'abort' result.
> 
> Signed-off-by: Petri Latvala <petri.latvala at intel.com>
> Cc: Arkadiusz Hiler <arek at hiler.eu>
> ---
>  runner/resultgen.c | 21 +++++++++++++--------
>  1 file changed, 13 insertions(+), 8 deletions(-)
> 
> diff --git a/runner/resultgen.c b/runner/resultgen.c
> index 8d0c6249..b74970a6 100644
> --- a/runner/resultgen.c
> +++ b/runner/resultgen.c
> @@ -656,19 +656,24 @@ static void process_dynamic_subtest_output(const char *piglit_name,
>                                              dynend);
>  
>                         /*
> -                        * If a dynamic subsubtest is considered incomplete we
> -                        * need to check parent's status first, to be sure that
> -                        * the binary hasn't aborted (exit code). If it has
> -                        * aborted then we have to attribute this status to our
> -                        * subsubtest.
> +                        * If a dynamic subsubtest is considered
> +                        * incomplete we need to check parent's status
> +                        * first, to be sure that the binary hasn't
> +                        * aborted or stopped gracefully (exit
> +                        * code). If it has aborted then we have to
> +                        * attribute this status to our subsubtest.
>                          */
>                         if (!strcmp(dynresulttext, "incomplete")) {
>                                 struct json_object *parent_subtest;
>  
>                                 if (json_object_object_get_ex(tests, piglit_name, &parent_subtest) &&
> -                                   json_object_object_get_ex(parent_subtest, "result", &parent_subtest) &&
> -                                   !strcmp(json_object_get_string(parent_subtest), "abort"))
> -                                       dynresulttext = "abort";
> +                                   json_object_object_get_ex(parent_subtest, "result", &parent_subtest)) {
> +                                       const char *resulttext = json_object_get_string(parent_subtest);
> +
> +                                       if (!strcmp(resulttext, "abort") ||
> +                                           !strcmp(resulttext, "notrun"))
> +                                               dynresulttext = resulttext;
> +                               }

Afaict, this matches the comment and that matches my basic understanding
of the problem, so

Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris


More information about the igt-dev mailing list