Index: src/test/java/org/apache/jackrabbit/core/AbstractConcurrencyTest.java =================================================================== --- src/test/java/org/apache/jackrabbit/core/AbstractConcurrencyTest.java (Revision 749266) +++ src/test/java/org/apache/jackrabbit/core/AbstractConcurrencyTest.java (Arbeitskopie) @@ -23,8 +23,6 @@ import javax.jcr.Session; import javax.jcr.Node; import javax.jcr.RepositoryException; -import java.lang.reflect.Method; -import java.lang.reflect.InvocationTargetException; /** * AbstractConcurrencyTest provides utility methods to run tests @@ -112,25 +110,11 @@ for (int i = 0; i < threads.length; i++) { threads[i].start(); } - boolean stacksDumped = false; for (int i = 0; i < threads.length; i++) { try { - long wait = Math.max(timeout - System.currentTimeMillis(), 1000); - threads[i].join(wait); - if (threads[i].isAlive()) { - if (!stacksDumped) { - dumpStacks(threads); - stacksDumped = true; - } - threads[i].interrupt(); - // give the thread a couple of seconds, then call stop - Thread.sleep(5 * 1000); - if (threads[i].isAlive()) { - threads[i].stop(); - } - } + threads[i].join(); } catch (InterruptedException e) { - // ignore + logger.warn("Interrupted while joining thread {}", threads[i]); } } for (int i = 0; i < executors.length; i++) { @@ -145,33 +129,6 @@ } /** - * If tests are run in a 1.5 JVM or higher the stack of the given threads - * are dumped to the logger with level ERROR. - */ - protected static void dumpStacks(Thread[] threads) { - try { - Method m = Thread.class.getMethod("getStackTrace", null); - StringBuffer dumps = new StringBuffer(); - for (int t = 0; t < threads.length; t++) { - StackTraceElement[] elements = (StackTraceElement[]) m.invoke( - threads[t], null); - dumps.append(threads[t].toString()).append('\n'); - for (int i = 0; i < elements.length; i++) { - dumps.append("\tat " + elements[i]).append('\n'); - } - dumps.append('\n'); - } - logger.error("Thread dumps:\n{}", dumps); - } catch (NoSuchMethodException e) { - // not a 1.5 JVM - } catch (IllegalAccessException e) { - // ignore - } catch (InvocationTargetException e) { - // ignore - } - } - - /** * Task implementations must be thread safe! Multiple threads will call * {@link #execute(Session, Node)} concurrently. */ @@ -202,12 +159,14 @@ } public void run() { + logger.info("Starting task {}", task); try { task.execute(session, test); } catch (RepositoryException e) { exception = e; } finally { session.logout(); + logger.info("Ending task {}", task); } } }