Patchwork run-tests: set the thread name to the test name for info on error

login
register
mail settings
Submitter Simon Heimberg
Date Jan. 16, 2014, 10:30 a.m.
Message ID <34a816e97e692cc547dd.1389868219@lapsi.heimberg.home>
Download mbox | patch
Permalink /patch/3346/
State Accepted
Headers show

Comments

Simon Heimberg - Jan. 16, 2014, 10:30 a.m.
# HG changeset patch
# User Simon Heimberg <simohe@besonet.ch>
# Date 1389868014 -3600
# Node ID 34a816e97e692cc547dde29fa4d95dcd7e918b3d
# Parent  151865db7b7b9597509b2631f604f08d9a137b32
run-tests: set the thread name to the test name for info on error

This does not happen when running normal. But when fiddling around with
the test infrastructure, this helps a lot.

  Old traceback messge
Exception in thread Thread-7:
Traceback (most recent call last):
...

  new traceback message
Exception in thread test-something.t:
Traceback (most recent call last):
...
Augie Fackler - Jan. 16, 2014, 2:35 p.m.
On Thu, Jan 16, 2014 at 11:30:19AM +0100, Simon Heimberg wrote:
> # HG changeset patch
> # User Simon Heimberg <simohe@besonet.ch>
> # Date 1389868014 -3600
> # Node ID 34a816e97e692cc547dde29fa4d95dcd7e918b3d
> # Parent  151865db7b7b9597509b2631f604f08d9a137b32
> run-tests: set the thread name to the test name for info on error

Sounds reasonable, queued.

>
> This does not happen when running normal. But when fiddling around with
> the test infrastructure, this helps a lot.
>
>   Old traceback messge
> Exception in thread Thread-7:
> Traceback (most recent call last):
> ...
>
>   new traceback message
> Exception in thread test-something.t:
> Traceback (most recent call last):
> ...
>
> diff -r 151865db7b7b -r 34a816e97e69 tests/run-tests.py
> --- a/tests/run-tests.py	Son Nov 17 15:57:52 2013 +0100
> +++ b/tests/run-tests.py	Don Jan 16 11:26:54 2014 +0100
> @@ -1108,7 +1108,7 @@
>                  test = tests.pop(0)
>                  if options.loop:
>                      tests.append(test)
> -                t = threading.Thread(target=job, args=(test, count))
> +                t = threading.Thread(target=job, name=test, args=(test, count))
>                  t.start()
>                  running += 1
>                  count += 1
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff -r 151865db7b7b -r 34a816e97e69 tests/run-tests.py
--- a/tests/run-tests.py	Son Nov 17 15:57:52 2013 +0100
+++ b/tests/run-tests.py	Don Jan 16 11:26:54 2014 +0100
@@ -1108,7 +1108,7 @@ 
                 test = tests.pop(0)
                 if options.loop:
                     tests.append(test)
-                t = threading.Thread(target=job, args=(test, count))
+                t = threading.Thread(target=job, name=test, args=(test, count))
                 t.start()
                 running += 1
                 count += 1