提交 c4c55d1c 编写于 作者: J Jesse Glick

waitUntilNoActivityUpTo should also produce a thread dump (despite 80da8f29).

上级 2b6c00db
......@@ -386,18 +386,21 @@ public class JenkinsRule implements TestRule, MethodRule, RootAction {
public void run() {
if (timeoutTimer!=null) {
LOGGER.warning(String.format("Test timed out (after %d seconds).", timeout));
// dump threads
ThreadInfo[] threadInfos = Functions.getThreadInfos();
Functions.ThreadGroupMap m = Functions.sortThreadsAndGetGroupMap(threadInfos);
for (ThreadInfo ti : threadInfos) {
System.err.println(Functions.dumpThreadInfo(ti, m));
}
dumpThreads();
testThread.interrupt();
}
}
}, TimeUnit.SECONDS.toMillis(timeout));
}
private static void dumpThreads() {
ThreadInfo[] threadInfos = Functions.getThreadInfos();
Functions.ThreadGroupMap m = Functions.sortThreadsAndGetGroupMap(threadInfos);
for (ThreadInfo ti : threadInfos) {
System.err.println(Functions.dumpThreadInfo(ti, m));
}
}
/**
* Override to tear down your specific external resource.
*/
......@@ -1481,7 +1484,8 @@ public class JenkinsRule implements TestRule, MethodRule, RootAction {
building.add(e.getCurrentExecutable());
}
}
throw new AssertionError(String.format("Hudson is still doing something after %dms: queue=%s building=%s",
dumpThreads();
throw new AssertionError(String.format("Jenkins is still doing something after %dms: queue=%s building=%s",
timeout, Arrays.asList(jenkins.getQueue().getItems()), building));
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册