I will look into that as well. Shai
On Thursday, December 9, 2010, Uwe Schindler <[email protected]> wrote: > Have not looked into this, but as far as I know it the printout *before* the > check for the other thread's exception status in teardown. > > ----- > Uwe Schindler > H.-H.-Meier-Allee 63, D-28213 Bremen > http://www.thetaphi.de > eMail: [email protected] > > >> -----Original Message----- >> From: Michael McCandless [mailto:[email protected]] >> Sent: Thursday, December 09, 2010 5:06 PM >> To: [email protected] >> Subject: Re: TestSearchWithThreads failure >> >> On Thu, Dec 9, 2010 at 10:32 AM, Shai Erera <[email protected]> wrote: >> > Hi >> > >> > I've hit this: >> > >> > [junit] Testsuite: org.apache.lucene.search.TestSearchWithThreads >> > [junit] Testcase: >> > test(org.apache.lucene.search.TestSearchWithThreads): FAILED >> > [junit] Some threads threw uncaught exceptions! >> > [junit] junit.framework.AssertionFailedError: Some threads threw >> > uncaught exceptions! >> > [junit] at >> > >> org.apache.lucene.util.LuceneTestCase$LuceneTestCaseRunner.runChild(Lu >> > ceneTestCase.java:1039) >> > [junit] at >> > >> org.apache.lucene.util.LuceneTestCase$LuceneTestCaseRunner.runChild(Lu >> > ceneTestCase.java:977) >> > [junit] at >> > >> org.apache.lucene.util.LuceneTestCase.tearDown(LuceneTestCase.java:478 >> > ) >> > [junit] >> > [junit] >> > [junit] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 1.487 >> > sec >> > [junit] >> > [junit] ------------- Standard Error ----------------- >> > [junit] The following exceptions were thrown by threads: >> > [junit] *** Thread: Thread-98 *** >> > [junit] java.lang.AssertionError: >> > [junit] at org.junit.Assert.fail(Assert.java:91) >> > [junit] at org.junit.Assert.assertTrue(Assert.java:43) >> > [junit] at org.junit.Assert.assertTrue(Assert.java:55) >> > [junit] at >> > >> org.apache.lucene.search.TestSearchWithThreads$1.run(TestSearchWithThr >> > eads.java:88) >> > [junit] *** Thread: Thread-100 *** >> > [junit] java.lang.AssertionError: >> > [junit] at org.junit.Assert.fail(Assert.java:91) >> > [junit] at org.junit.Assert.assertTrue(Assert.java:43) >> > [junit] at org.junit.Assert.assertTrue(Assert.java:55) >> > [junit] at >> > >> org.apache.lucene.search.TestSearchWithThreads$1.run(TestSearchWithThr >> > eads.java:88) >> > [junit] ------------- ---------------- --------------- >> > [junit] TEST org.apache.lucene.search.TestSearchWithThreads FAILED >> > >> > No 'reproduce' command, and I ran the test alone as well as test-core >> > multiple times since and wasn't able to reproduce since. >> >> Hmm why no repro command? That's no good. Maybe if a test fails only due >> to threads other than main, we fail to print repro? >> >> > The failure is on this line: assertTrue(totHits > 0); >> > >> > Looking in the code, there are two possible causes I can think of: >> > >> > 1) The while() loop isn't executed because the machine hiccup or >> > something and stopAt reached before reaching while() ... or failed.get() > is >> true. >> > --> we need to fix the assert in any case I think, to assert >> > --> !failed.get() >> > && totalHits > 0 ... otherwise it will fail, potentially masking the >> > original failure. >> > --> we need to set a boolean inside the loop, e.g. "ran=true" and >> > incorporate that in the assert. >> >> Good, I agree! And I think also change assert to tolerate numSearch == 0? > Ie< --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
