lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shai Erera <ser...@gmail.com>
Subject Re: LuceneTestCase.threadCleanup incorrectly reports left running threads
Date Thu, 23 Dec 2010 07:09:19 GMT
I ran the test from both eclipse and Ant, and got similar warnings.

With your patch most of the 'false alarms' do not show up again, but I still
see a strange failure. I add this to after the System.err.print("left thread
running"): System.err.println(Arrays.toString(t.getStackTrace())); -- it
prints the stack trace. And here is what I get:

    [junit] ------------- Standard Error -----------------
    [junit] WARNING: test method: 'testIndexAndSearchTasks' left thread
running: Thread[file lock watchdog,6,main]
    [junit] [java.lang.Object.wait(Native Method),
java.lang.Object.wait(Object.java:167),
java.util.Timer$TimerImpl.run(Timer.java:226)]
    [junit] RESOURCE LEAK: test method: 'testIndexAndSearchTasks' left 1
thread(s) running
    [junit] NOTE: reproduce with: ant test -Dtestcase=TestPerfTasksLogic
-Dtestmethod=testIndexAndSearchTasks
-Dtests.seed=-792089523312439823:1164084411683706634

I don't know where this Timer is created, but I'll dig more.

At any rate, I think your patch is good, and perhaps we should add the
stacktrace print as well, to help with the debugging?

Shai

On Wed, Dec 22, 2010 at 9:35 PM, Robert Muir <rcmuir@gmail.com> wrote:

>  static {
> +    // just a hack for things like eclipse threads
> +    for (Thread t : Thread.getAllStackTraces().keySet()) {
> +      rogueThreads.put(t, true);
> +    }
> +  }
>

Mime
View raw message