From 0478efb68130fd434ff83829633d6f3d51e6a569 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Thu, 11 Feb 2010 01:41:09 +0000 Subject: [PATCH] override the thread name to make the thread dump more useful, especially in case of a hang. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@27302 71c3de6d-444a-0410-be80-ed276b4c234a --- .../java/org/jvnet/hudson/test/HudsonTestCase.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java b/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java index 9198714486..2c43164a7e 100644 --- a/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java +++ b/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java @@ -222,6 +222,19 @@ public abstract class HudsonTestCase extends TestCase implements RootAction { protected HudsonTestCase() { } + @Override + public void runBare() throws Throwable { + // override the thread name to make the thread dump more useful. + Thread t = Thread.currentThread(); + String o = getClass().getName()+'.'+t.getName(); + t.setName("Executing "+getName()); + try { + super.runBare(); + } finally { + t.setName(o); + } + } + @Override protected void setUp() throws Exception { env.pin();