[Piglit] [PATCH] framework: Make the logger print spinners instead of test numbers.

Dylan Baker baker.dylan.c at gmail.com
Mon Nov 24 00:35:26 PST 2014


Ideally I'd figure out why our timeout mechanism + concurrency = double
free's in python and we'd just use timeouts and not need any printout at
all. Which was my plan I was sidetracked from...

Also, with the atomic backend those numbers should line up with the file
numbers (they are not generated from the same source, but they are
generated with the same pattern) in ${results_dir}/tests, which makes your
statement "the number is meaningless" not completely true :)

On Mon, Nov 24, 2014 at 12:12 AM, Kenneth Graunke <kenneth at whitecape.org>
wrote:

> Printing out test numbers frequently exceeds the 80 character limit,
> at which point the logger starts writing many copies of the progress
> bar instead of overwriting it.  It also prompts people to say things
> like "hey, test 8423 is broken!" without realizing that tests are run
> in a nondeterministic order, so the number is meaningless.
>
> The real point was to be able to see when a thread gets stuck - i.e.
> one test keeps running forever.  We can easily show this with ASCII
> progress spinners.
>
> Instead of:
>
> [16816/16822] crash: 21, fail: 82, pass: 12307, skip: 4401, warn: 5
> Running Test(s): 16814 16815 16816 16817 16818 16819 16820 16821
>
> We now get the much more compact:
>
> [09984/16822] crash: 12, fail: 53, pass: 7314, skip: 2601, warn: 4:
> ||\-\|/-
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  framework/log.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/framework/log.py b/framework/log.py
> index caad972..0c9489e 100644
> --- a/framework/log.py
> +++ b/framework/log.py
> @@ -149,12 +149,12 @@ class QuietLog(BaseLog):
>          """
>          assert self._LOCK.locked()
>
> -        out = '[{done}/{total}] {status} Running Test(s):
> {running}'.format(
> +        out = '[{done}/{total}] {status}: {running}'.format(
>              done=str(self._state['complete']).zfill(self._pad),
>              total=str(self._state['total']).zfill(self._pad),
>              status=', '.join('{0}: {1}'.format(k, v) for k, v in
>                               sorted(self._state['summary'].iteritems())),
> -            running=" ".join(str(x) for x in self._state['running'])
> +            running=''.join('|/-\\'[x % 4] for x in
> self._state['running'])
>          )
>
>          self._print(out)
> --
> 2.1.3
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20141124/b6bb85d0/attachment.html>


More information about the Piglit mailing list