You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Chris Hostetter <ho...@fucit.org> on 2012/05/01 00:19:31 UTC

Re: hudson hung

: > Can we somehow fix our tests / Jenkins to detect hangs and kill/fail...?

FYI: it's pretty trivial to have jenkins abort any build that has been 
running more then X minutes.

check the "Abort the build if it's stuck" checkbox (under "Build 
Environment") and then select the number of total minutes to wait, and 
wether you want the abort to be considered a failure or not.

: It's built in in the runner actually but not enabled... I'd have to
: play with it first to see if everything works fine (it should!), but
: feel free to do some testing -- add

that sounds like a much better plan.

: @Timeout(millis=?)
: 
: to LuceneTestCase and each test will expire after a given time (with
: all of its thread group's threads being interrupted first and then
: stopped if this doesn't help).


just to clarify: your'e saying that if we put that anotation on a class, 
like LuceneTestCase, it will apply to any test *method* in that class (or 
subclasses) ... and presumably if a subclass uses that anotation with a 
diff millis value, that will override the superclass.

correct?



-Hoss

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: hudson hung

Posted by Dawid Weiss <da...@cs.put.poznan.pl>.
> Hmm, as a test, I tried adding @Timeout(millis=100000) to
> LuceneTestCase, ie 100 seconds, which I think should not trigger on
> any core tests today.
>
> That should then apply to all subclasses of LuceneTestCase right?  Ie
> all tests will be aborted after 100 seconds...

Yes, it should abort each test after 100 seconds (or not if it
completes earlier).

> But, something is wrong: I get lots of quick (ie much less than 100
> seconds) failures like this:
>
>   [junit4] Suite: org.apache.lucene.util.TestRamUsageEstimatorOnWildAnimals
>   [junit4] ERROR   0.00s J2 | TestRamUsageEstimatorOnWildAnimals (suite)
>   [junit4]    > Throwable #1: java.lang.RuntimeException: Interrupted
> while waiting for worker? Weird.

I'm not sure what's wrong and I'm not able to tell you right now
(vacation...). I will look into this once I come back.

The problem of "stopping" a running test is not trivial because there
are no easy ways of telling which threads have been started from a
test, which threads should outlive the test (as in a threadpool
initialized from @BeforeClass but used from within a test -- the pool
threads should outlive it)... finally there are cases when a thread
just won't make it possible to be killed by an external threads (see
test cases in randomizedtesting -- look for zombie tests if you're
curious).

There are many sneaky scenarios. The timeout on jenkins is also not
trivial I think. Uwe was reporting that stopping a build on jenkins
leaves forked jvms running in the background. I looked into jenkins
source code to see how they're killing those running processes... it's
really hairy -- os-dependent and doing scans of /proc... brr...
Apparently also not an easy thing to do.

I'll upgrade junit4 and randomizedtesting to version 1.4.0 which
should fix a few problems related to event passing but I'll have to
postpone timeouts until I'm back at work full time.

Dawid

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: hudson hung

Posted by Shai Erera <se...@gmail.com>.
Yes I figured it has to do with the runner. Good though that I can control
it with a -Dtests.timeout property.

I guess that I need to specify that as sysproperty in my build.xml?

Shai

On Wed, May 2, 2012 at 1:39 PM, Dawid Weiss <da...@cs.put.poznan.pl>wrote:

> > Can I use the randomized.jar with Lucene 3.6 test-framework? I guess not
>
> Yes and no. You'd need to integrate the sources (LuceneTestCase) with
> the runner first (@RunWith(RandomizedRunner.class)). I haven't tested
> 3.6 but there are nuances that go beyond trivial substitutions. See
> the patch when this was done for the trunk and you'll see how large
> the commit was.
>
> > because the Timeout annotation doesn't work - I added it with millis=10
> but
> > a test ran for 20 seconds uninterrupted.
>
> It's because this annotation is supported only by the runner above.
> The default JUnit runner doesn't know anything about it so it's
> ignored.
>
> > Also, what I did with JUnit's timeout is control the timeout through a
> > system property -- how do I do that with the randomized timeout?
>
> Yes, you can control the timeouts globally via
> -Dtests.timeout=[millis] (or an annotation on the superclass). Again,
> this requires that a suite is executed under randomized runner (not
> the default one from junit).
>
> Dawid
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>

Re: hudson hung

Posted by Dawid Weiss <da...@cs.put.poznan.pl>.
> Can I use the randomized.jar with Lucene 3.6 test-framework? I guess not

Yes and no. You'd need to integrate the sources (LuceneTestCase) with
the runner first (@RunWith(RandomizedRunner.class)). I haven't tested
3.6 but there are nuances that go beyond trivial substitutions. See
the patch when this was done for the trunk and you'll see how large
the commit was.

> because the Timeout annotation doesn't work - I added it with millis=10 but
> a test ran for 20 seconds uninterrupted.

It's because this annotation is supported only by the runner above.
The default JUnit runner doesn't know anything about it so it's
ignored.

> Also, what I did with JUnit's timeout is control the timeout through a
> system property -- how do I do that with the randomized timeout?

Yes, you can control the timeouts globally via
-Dtests.timeout=[millis] (or an annotation on the superclass). Again,
this requires that a suite is executed under randomized runner (not
the default one from junit).

Dawid

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: hudson hung

Posted by Shai Erera <se...@gmail.com>.
Can I use the randomized.jar with Lucene 3.6 test-framework? I guess not
because the Timeout annotation doesn't work - I added it with millis=10 but
a test ran for 20 seconds uninterrupted.

Also, what I did with JUnit's timeout is control the timeout through a
system property -- how do I do that with the randomized timeout?

Shai

On Wed, May 2, 2012 at 12:09 PM, Dawid Weiss
<da...@cs.put.poznan.pl>wrote:

> Don't use junit's Timeout rule -- what it does is it spins off a new
> thread and start clocking its execution but doesn't do any proper
> cleanup (it only calls interrupt) and may even leave a test thread
> running (if it captures interrupted exception) and will leave all
> forked threads running (because it doesn't attempt to clean them up).
>
> That Timeout rule may be good for simple single-threaded tests but
> Lucene and Solr tests are not among these...
>
> Dawid
>
> On Tue, May 1, 2012 at 3:59 PM, Shai Erera <se...@gmail.com> wrote:
> > I tried to enforce a Timeout using this code, added to my top-level test
> > case (didn't try yet on LTC):
> >
> >     @Rule
> >     public static Timeout globalTimeout = new Timeout(100000); // 100
> > seconds
> >
> > This comes straight from JUnit. I don't have the randomizedtesting jar
> in my
> > project, so I couldn't add the @Timeout annotation.
> >
> > When I set it to a low value (20 ms), many tests failed as expected.
> > However, on one occasion, a test took 135 seconds, as reported by JUnit
> in
> > eclipse, and still didn't fail ! I don't know what it means though -- the
> > test usually doesn't take more than 15 seconds to run, so perhaps the
> > computer was busy, and therefore even the timeout thread didn't get the
> > chance to fail ... or perhaps the time reported by eclipse is inaccurate.
> >
> > Anyway, perhaps try with that (just add it to LTC anywhere).
> >
> > Shai
> >
> >
> > On Tue, May 1, 2012 at 4:05 PM, Michael McCandless
> > <lu...@mikemccandless.com> wrote:
> >>
> >> Hmm, as a test, I tried adding @Timeout(millis=100000) to
> >> LuceneTestCase, ie 100 seconds, which I think should not trigger on
> >> any core tests today.
> >>
> >> That should then apply to all subclasses of LuceneTestCase right?  Ie
> >> all tests will be aborted after 100 seconds...
> >>
> >> But, something is wrong: I get lots of quick (ie much less than 100
> >> seconds) failures like this:
> >>
> >>   [junit4] Suite:
> >> org.apache.lucene.util.TestRamUsageEstimatorOnWildAnimals
> >>   [junit4] ERROR   0.00s J2 | TestRamUsageEstimatorOnWildAnimals (suite)
> >>   [junit4]    > Throwable #1: java.lang.RuntimeException: Interrupted
> >> while waiting for worker? Weird.
> >>   [junit4]    >        at
> >> __randomizedtesting.SeedInfo.seed([329191043FC42BEA]:0)
> >>   [junit4]    >        at
> >>
> >>
> com.carrotsearch.randomizedtesting.RandomizedRunner.runAndWait(RandomizedRunner.java:786)
> >>   [junit4]    >        at
> >>
> >>
> com.carrotsearch.randomizedtesting.RandomizedRunner.access$900(RandomizedRunner.java:131)
> >>   [junit4]    >        at
> >>
> >>
> com.carrotsearch.randomizedtesting.RandomizedRunner$3.evaluate(RandomizedRunner.java:689)
> >>   [junit4]    >        at
> >>
> >>
> com.carrotsearch.randomizedtesting.RandomizedRunner$4.evaluate(RandomizedRunner.java:723)
> >>   [junit4]    >        at
> >>
> >>
> com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:734)
> >>   [junit4]    >        at
> >>
> >>
> org.apache.lucene.util.UncaughtExceptionsRule$1.evaluate(UncaughtExceptionsRule.java:75)
> >>   [junit4]    >        at
> >>
> >>
> org.apache.lucene.util.StoreClassNameRule$1.evaluate(StoreClassNameRule.java:38)
> >>   [junit4]    >        at
> >>
> >>
> org.apache.lucene.util.SystemPropertiesInvariantRule$1.evaluate(SystemPropertiesInvariantRule.java:69)
> >>   [junit4]    >        at
> >>
> >>
> com.carrotsearch.randomizedtesting.RandomizedRunner.runSuite(RandomizedRunner.java:604)
> >>   [junit4]    >        at
> >>
> >>
> com.carrotsearch.randomizedtesting.RandomizedRunner.access$400(RandomizedRunner.java:131)
> >>   [junit4]    >        at
> >>
> >>
> com.carrotsearch.randomizedtesting.RandomizedRunner$2.run(RandomizedRunner.java:550)
> >>   [junit4]    > Caused by: java.lang.InterruptedException
> >>   [junit4]    >        at java.lang.Object.wait(Native Method)
> >>   [junit4]    >        at java.lang.Thread.join(Thread.java:1266)
> >>   [junit4]    >        at
> >>
> >>
> com.carrotsearch.randomizedtesting.RandomizedRunner.runAndWait(RandomizedRunner.java:776)
> >>   [junit4]    >        ... 10 more
> >>   [junit4]    >
> >>   [junit4] Completed on J2 in 0.34s, 1 test, 1 error <<< FAILURES!
> >>   [junit4]
> >>   [junit4] May 01, 2012 9:02:18 AM
> >>
> >>
> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus
> >> dispatch
> >>   [junit4] SEVERE: Could not dispatch event:
> >>
> >>
> com.carrotsearch.ant.tasks.junit4.events.aggregated.AggregatedSuiteResultEvent@6637b753
> >> to handler [wrapper public void
> >>
> >>
> com.carrotsearch.ant.tasks.junit4.listeners.TextReport.onSuiteResult(com.carrotsearch.ant.tasks.junit4.events.aggregated.AggregatedSuiteResultEvent)]
> >>   [junit4] java.lang.reflect.InvocationTargetException
> >>   [junit4]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> >> Method)
> >>   [junit4]     at
> >>
> >>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> >>   [junit4]     at
> >>
> >>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >>   [junit4]     at java.lang.reflect.Method.invoke(Method.java:601)
> >>   [junit4]     at
> >>
> >>
> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:68)
> >>   [junit4]     at
> >>
> >>
> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
> >>   [junit4]     at
> >>
> >>
> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
> >>   [junit4]     at
> >>
> >>
> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
> >>   [junit4]     at
> >>
> >>
> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.post(EventBus.java:264)
> >>   [junit4]     at
> >>
> >>
> com.carrotsearch.ant.tasks.junit4.events.aggregated.AggregatingListener.receiveSuiteEnd(AggregatingListener.java:130)
> >>   [junit4]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> >> Method)
> >>   [junit4]     at
> >>
> >>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> >>   [junit4]     at
> >>
> >>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >>   [junit4]     at java.lang.reflect.Method.invoke(Method.java:601)
> >>   [junit4]     at
> >>
> >>
> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:68)
> >>   [junit4]     at
> >>
> >>
> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
> >>   [junit4]     at
> >>
> >>
> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
> >>   [junit4]     at
> >>
> >>
> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
> >>   [junit4]     at
> >>
> >>
> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.post(EventBus.java:264)
> >>   [junit4]     at
> >>
> >>
> com.carrotsearch.ant.tasks.junit4.LocalSlaveStreamHandler.pumpEvents(LocalSlaveStreamHandler.java:139)
> >>   [junit4]     at
> >>
> >>
> com.carrotsearch.ant.tasks.junit4.LocalSlaveStreamHandler$1.run(LocalSlaveStreamHandler.java:81)
> >>   [junit4]     at java.lang.Thread.run(Thread.java:722)
> >>   [junit4] Caused by: java.lang.RuntimeException: Unfinished
> >> test?org.apache.lucene.util.TestRamUsageEstimatorOnWildAnimals,
> >>
> >>
> testOverflowMaxChainLength(org.apache.lucene.util.TestRamUsageEstimatorOnWildAnimals)
> >>   [junit4]     at
> >>
> >>
> com.carrotsearch.ant.tasks.junit4.events.aggregated.AggregatedTestResultEvent.getEventStream(AggregatedTestResultEvent.java:87)
> >>   [junit4]     at
> >>
> >>
> com.carrotsearch.ant.tasks.junit4.listeners.TextReport.format(TextReport.java:411)
> >>   [junit4]     at
> >>
> >>
> com.carrotsearch.ant.tasks.junit4.listeners.TextReport.onSuiteResult(TextReport.java:216)
> >>   [junit4]     ... 22 more
> >>
> >> Not sure what's up...
> >>
> >> Mike McCandless
> >>
> >> http://blog.mikemccandless.com
> >>
> >> On Mon, Apr 30, 2012 at 6:24 PM, Dawid Weiss
> >> <da...@cs.put.poznan.pl> wrote:
> >> >> just to clarify: your'e saying that if we put that anotation on a
> >> >> class,
> >> >> like LuceneTestCase, it will apply to any test *method* in that class
> >> >> (or
> >> >> subclasses) ... and presumably if a subclass uses that anotation
> with a
> >> >> diff millis value, that will override the superclass.
> >> >
> >> > Correct. You can also apply it to a particular method to have
> >> > per-method adjustment. In fact, @Timeout is somewhat redundant since
> >> > @Test also has a "timeout" attribute... and this will also work. But I
> >> > thought a consistent @Timeout would be nicer (applied to class,
> >> > method, wherever). Up to your taste I guess.
> >> >
> >> > There is one issue with timeouts -- they apply to test cases _only_,
> >> > not to suite-level code (@BeforeClass, @ClassRules). I don't know if
> >> > this qualifies as a bug or feature -- haven't developed that gut
> >> > feeing yet...
> >> >
> >> > Dawid
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> >> > For additional commands, e-mail: dev-help@lucene.apache.org
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> >> For additional commands, e-mail: dev-help@lucene.apache.org
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>

Re: hudson hung

Posted by Dawid Weiss <da...@cs.put.poznan.pl>.
Don't use junit's Timeout rule -- what it does is it spins off a new
thread and start clocking its execution but doesn't do any proper
cleanup (it only calls interrupt) and may even leave a test thread
running (if it captures interrupted exception) and will leave all
forked threads running (because it doesn't attempt to clean them up).

That Timeout rule may be good for simple single-threaded tests but
Lucene and Solr tests are not among these...

Dawid

On Tue, May 1, 2012 at 3:59 PM, Shai Erera <se...@gmail.com> wrote:
> I tried to enforce a Timeout using this code, added to my top-level test
> case (didn't try yet on LTC):
>
>     @Rule
>     public static Timeout globalTimeout = new Timeout(100000); // 100
> seconds
>
> This comes straight from JUnit. I don't have the randomizedtesting jar in my
> project, so I couldn't add the @Timeout annotation.
>
> When I set it to a low value (20 ms), many tests failed as expected.
> However, on one occasion, a test took 135 seconds, as reported by JUnit in
> eclipse, and still didn't fail ! I don't know what it means though -- the
> test usually doesn't take more than 15 seconds to run, so perhaps the
> computer was busy, and therefore even the timeout thread didn't get the
> chance to fail ... or perhaps the time reported by eclipse is inaccurate.
>
> Anyway, perhaps try with that (just add it to LTC anywhere).
>
> Shai
>
>
> On Tue, May 1, 2012 at 4:05 PM, Michael McCandless
> <lu...@mikemccandless.com> wrote:
>>
>> Hmm, as a test, I tried adding @Timeout(millis=100000) to
>> LuceneTestCase, ie 100 seconds, which I think should not trigger on
>> any core tests today.
>>
>> That should then apply to all subclasses of LuceneTestCase right?  Ie
>> all tests will be aborted after 100 seconds...
>>
>> But, something is wrong: I get lots of quick (ie much less than 100
>> seconds) failures like this:
>>
>>   [junit4] Suite:
>> org.apache.lucene.util.TestRamUsageEstimatorOnWildAnimals
>>   [junit4] ERROR   0.00s J2 | TestRamUsageEstimatorOnWildAnimals (suite)
>>   [junit4]    > Throwable #1: java.lang.RuntimeException: Interrupted
>> while waiting for worker? Weird.
>>   [junit4]    >        at
>> __randomizedtesting.SeedInfo.seed([329191043FC42BEA]:0)
>>   [junit4]    >        at
>>
>> com.carrotsearch.randomizedtesting.RandomizedRunner.runAndWait(RandomizedRunner.java:786)
>>   [junit4]    >        at
>>
>> com.carrotsearch.randomizedtesting.RandomizedRunner.access$900(RandomizedRunner.java:131)
>>   [junit4]    >        at
>>
>> com.carrotsearch.randomizedtesting.RandomizedRunner$3.evaluate(RandomizedRunner.java:689)
>>   [junit4]    >        at
>>
>> com.carrotsearch.randomizedtesting.RandomizedRunner$4.evaluate(RandomizedRunner.java:723)
>>   [junit4]    >        at
>>
>> com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:734)
>>   [junit4]    >        at
>>
>> org.apache.lucene.util.UncaughtExceptionsRule$1.evaluate(UncaughtExceptionsRule.java:75)
>>   [junit4]    >        at
>>
>> org.apache.lucene.util.StoreClassNameRule$1.evaluate(StoreClassNameRule.java:38)
>>   [junit4]    >        at
>>
>> org.apache.lucene.util.SystemPropertiesInvariantRule$1.evaluate(SystemPropertiesInvariantRule.java:69)
>>   [junit4]    >        at
>>
>> com.carrotsearch.randomizedtesting.RandomizedRunner.runSuite(RandomizedRunner.java:604)
>>   [junit4]    >        at
>>
>> com.carrotsearch.randomizedtesting.RandomizedRunner.access$400(RandomizedRunner.java:131)
>>   [junit4]    >        at
>>
>> com.carrotsearch.randomizedtesting.RandomizedRunner$2.run(RandomizedRunner.java:550)
>>   [junit4]    > Caused by: java.lang.InterruptedException
>>   [junit4]    >        at java.lang.Object.wait(Native Method)
>>   [junit4]    >        at java.lang.Thread.join(Thread.java:1266)
>>   [junit4]    >        at
>>
>> com.carrotsearch.randomizedtesting.RandomizedRunner.runAndWait(RandomizedRunner.java:776)
>>   [junit4]    >        ... 10 more
>>   [junit4]    >
>>   [junit4] Completed on J2 in 0.34s, 1 test, 1 error <<< FAILURES!
>>   [junit4]
>>   [junit4] May 01, 2012 9:02:18 AM
>>
>> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus
>> dispatch
>>   [junit4] SEVERE: Could not dispatch event:
>>
>> com.carrotsearch.ant.tasks.junit4.events.aggregated.AggregatedSuiteResultEvent@6637b753
>> to handler [wrapper public void
>>
>> com.carrotsearch.ant.tasks.junit4.listeners.TextReport.onSuiteResult(com.carrotsearch.ant.tasks.junit4.events.aggregated.AggregatedSuiteResultEvent)]
>>   [junit4] java.lang.reflect.InvocationTargetException
>>   [junit4]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> Method)
>>   [junit4]     at
>>
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>   [junit4]     at
>>
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>   [junit4]     at java.lang.reflect.Method.invoke(Method.java:601)
>>   [junit4]     at
>>
>> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:68)
>>   [junit4]     at
>>
>> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
>>   [junit4]     at
>>
>> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
>>   [junit4]     at
>>
>> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
>>   [junit4]     at
>>
>> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.post(EventBus.java:264)
>>   [junit4]     at
>>
>> com.carrotsearch.ant.tasks.junit4.events.aggregated.AggregatingListener.receiveSuiteEnd(AggregatingListener.java:130)
>>   [junit4]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> Method)
>>   [junit4]     at
>>
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>   [junit4]     at
>>
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>   [junit4]     at java.lang.reflect.Method.invoke(Method.java:601)
>>   [junit4]     at
>>
>> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:68)
>>   [junit4]     at
>>
>> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
>>   [junit4]     at
>>
>> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
>>   [junit4]     at
>>
>> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
>>   [junit4]     at
>>
>> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.post(EventBus.java:264)
>>   [junit4]     at
>>
>> com.carrotsearch.ant.tasks.junit4.LocalSlaveStreamHandler.pumpEvents(LocalSlaveStreamHandler.java:139)
>>   [junit4]     at
>>
>> com.carrotsearch.ant.tasks.junit4.LocalSlaveStreamHandler$1.run(LocalSlaveStreamHandler.java:81)
>>   [junit4]     at java.lang.Thread.run(Thread.java:722)
>>   [junit4] Caused by: java.lang.RuntimeException: Unfinished
>> test?org.apache.lucene.util.TestRamUsageEstimatorOnWildAnimals,
>>
>> testOverflowMaxChainLength(org.apache.lucene.util.TestRamUsageEstimatorOnWildAnimals)
>>   [junit4]     at
>>
>> com.carrotsearch.ant.tasks.junit4.events.aggregated.AggregatedTestResultEvent.getEventStream(AggregatedTestResultEvent.java:87)
>>   [junit4]     at
>>
>> com.carrotsearch.ant.tasks.junit4.listeners.TextReport.format(TextReport.java:411)
>>   [junit4]     at
>>
>> com.carrotsearch.ant.tasks.junit4.listeners.TextReport.onSuiteResult(TextReport.java:216)
>>   [junit4]     ... 22 more
>>
>> Not sure what's up...
>>
>> Mike McCandless
>>
>> http://blog.mikemccandless.com
>>
>> On Mon, Apr 30, 2012 at 6:24 PM, Dawid Weiss
>> <da...@cs.put.poznan.pl> wrote:
>> >> just to clarify: your'e saying that if we put that anotation on a
>> >> class,
>> >> like LuceneTestCase, it will apply to any test *method* in that class
>> >> (or
>> >> subclasses) ... and presumably if a subclass uses that anotation with a
>> >> diff millis value, that will override the superclass.
>> >
>> > Correct. You can also apply it to a particular method to have
>> > per-method adjustment. In fact, @Timeout is somewhat redundant since
>> > @Test also has a "timeout" attribute... and this will also work. But I
>> > thought a consistent @Timeout would be nicer (applied to class,
>> > method, wherever). Up to your taste I guess.
>> >
>> > There is one issue with timeouts -- they apply to test cases _only_,
>> > not to suite-level code (@BeforeClass, @ClassRules). I don't know if
>> > this qualifies as a bug or feature -- haven't developed that gut
>> > feeing yet...
>> >
>> > Dawid
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>> > For additional commands, e-mail: dev-help@lucene.apache.org
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: dev-help@lucene.apache.org
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: hudson hung

Posted by Shai Erera <se...@gmail.com>.
I tried to enforce a Timeout using this code, added to my top-level test
case (didn't try yet on LTC):

    @Rule
    public static Timeout globalTimeout = new Timeout(100000); // 100
seconds

This comes straight from JUnit. I don't have the randomizedtesting jar in
my project, so I couldn't add the @Timeout annotation.

When I set it to a low value (20 ms), many tests failed as expected.
However, on one occasion, a test took 135 seconds, as reported by JUnit in
eclipse, and still didn't fail ! I don't know what it means though -- the
test usually doesn't take more than 15 seconds to run, so perhaps the
computer was busy, and therefore even the timeout thread didn't get the
chance to fail ... or perhaps the time reported by eclipse is inaccurate.

Anyway, perhaps try with that (just add it to LTC anywhere).

Shai

On Tue, May 1, 2012 at 4:05 PM, Michael McCandless <
lucene@mikemccandless.com> wrote:

> Hmm, as a test, I tried adding @Timeout(millis=100000) to
> LuceneTestCase, ie 100 seconds, which I think should not trigger on
> any core tests today.
>
> That should then apply to all subclasses of LuceneTestCase right?  Ie
> all tests will be aborted after 100 seconds...
>
> But, something is wrong: I get lots of quick (ie much less than 100
> seconds) failures like this:
>
>   [junit4] Suite: org.apache.lucene.util.TestRamUsageEstimatorOnWildAnimals
>   [junit4] ERROR   0.00s J2 | TestRamUsageEstimatorOnWildAnimals (suite)
>   [junit4]    > Throwable #1: java.lang.RuntimeException: Interrupted
> while waiting for worker? Weird.
>   [junit4]    >        at
> __randomizedtesting.SeedInfo.seed([329191043FC42BEA]:0)
>   [junit4]    >        at
>
> com.carrotsearch.randomizedtesting.RandomizedRunner.runAndWait(RandomizedRunner.java:786)
>   [junit4]    >        at
>
> com.carrotsearch.randomizedtesting.RandomizedRunner.access$900(RandomizedRunner.java:131)
>   [junit4]    >        at
>
> com.carrotsearch.randomizedtesting.RandomizedRunner$3.evaluate(RandomizedRunner.java:689)
>   [junit4]    >        at
>
> com.carrotsearch.randomizedtesting.RandomizedRunner$4.evaluate(RandomizedRunner.java:723)
>   [junit4]    >        at
>
> com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:734)
>   [junit4]    >        at
>
> org.apache.lucene.util.UncaughtExceptionsRule$1.evaluate(UncaughtExceptionsRule.java:75)
>   [junit4]    >        at
>
> org.apache.lucene.util.StoreClassNameRule$1.evaluate(StoreClassNameRule.java:38)
>   [junit4]    >        at
>
> org.apache.lucene.util.SystemPropertiesInvariantRule$1.evaluate(SystemPropertiesInvariantRule.java:69)
>   [junit4]    >        at
>
> com.carrotsearch.randomizedtesting.RandomizedRunner.runSuite(RandomizedRunner.java:604)
>   [junit4]    >        at
>
> com.carrotsearch.randomizedtesting.RandomizedRunner.access$400(RandomizedRunner.java:131)
>   [junit4]    >        at
>
> com.carrotsearch.randomizedtesting.RandomizedRunner$2.run(RandomizedRunner.java:550)
>   [junit4]    > Caused by: java.lang.InterruptedException
>   [junit4]    >        at java.lang.Object.wait(Native Method)
>   [junit4]    >        at java.lang.Thread.join(Thread.java:1266)
>   [junit4]    >        at
>
> com.carrotsearch.randomizedtesting.RandomizedRunner.runAndWait(RandomizedRunner.java:776)
>   [junit4]    >        ... 10 more
>   [junit4]    >
>   [junit4] Completed on J2 in 0.34s, 1 test, 1 error <<< FAILURES!
>   [junit4]
>   [junit4] May 01, 2012 9:02:18 AM
>
> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus
> dispatch
>   [junit4] SEVERE: Could not dispatch event:
>
> com.carrotsearch.ant.tasks.junit4.events.aggregated.AggregatedSuiteResultEvent@6637b753
> to handler [wrapper public void
>
> com.carrotsearch.ant.tasks.junit4.listeners.TextReport.onSuiteResult(com.carrotsearch.ant.tasks.junit4.events.aggregated.AggregatedSuiteResultEvent)]
>   [junit4] java.lang.reflect.InvocationTargetException
>   [junit4]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
>   [junit4]     at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>   [junit4]     at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   [junit4]     at java.lang.reflect.Method.invoke(Method.java:601)
>   [junit4]     at
>
> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:68)
>   [junit4]     at
>
> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
>   [junit4]     at
>
> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
>   [junit4]     at
>
> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
>   [junit4]     at
>
> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.post(EventBus.java:264)
>   [junit4]     at
>
> com.carrotsearch.ant.tasks.junit4.events.aggregated.AggregatingListener.receiveSuiteEnd(AggregatingListener.java:130)
>   [junit4]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
>   [junit4]     at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>   [junit4]     at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   [junit4]     at java.lang.reflect.Method.invoke(Method.java:601)
>   [junit4]     at
>
> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:68)
>   [junit4]     at
>
> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
>   [junit4]     at
>
> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
>   [junit4]     at
>
> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
>   [junit4]     at
>
> com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.post(EventBus.java:264)
>   [junit4]     at
>
> com.carrotsearch.ant.tasks.junit4.LocalSlaveStreamHandler.pumpEvents(LocalSlaveStreamHandler.java:139)
>   [junit4]     at
>
> com.carrotsearch.ant.tasks.junit4.LocalSlaveStreamHandler$1.run(LocalSlaveStreamHandler.java:81)
>   [junit4]     at java.lang.Thread.run(Thread.java:722)
>   [junit4] Caused by: java.lang.RuntimeException: Unfinished
> test?org.apache.lucene.util.TestRamUsageEstimatorOnWildAnimals,
>
> testOverflowMaxChainLength(org.apache.lucene.util.TestRamUsageEstimatorOnWildAnimals)
>   [junit4]     at
>
> com.carrotsearch.ant.tasks.junit4.events.aggregated.AggregatedTestResultEvent.getEventStream(AggregatedTestResultEvent.java:87)
>   [junit4]     at
>
> com.carrotsearch.ant.tasks.junit4.listeners.TextReport.format(TextReport.java:411)
>   [junit4]     at
>
> com.carrotsearch.ant.tasks.junit4.listeners.TextReport.onSuiteResult(TextReport.java:216)
>   [junit4]     ... 22 more
>
> Not sure what's up...
>
> Mike McCandless
>
> http://blog.mikemccandless.com
>
> On Mon, Apr 30, 2012 at 6:24 PM, Dawid Weiss
> <da...@cs.put.poznan.pl> wrote:
> >> just to clarify: your'e saying that if we put that anotation on a class,
> >> like LuceneTestCase, it will apply to any test *method* in that class
> (or
> >> subclasses) ... and presumably if a subclass uses that anotation with a
> >> diff millis value, that will override the superclass.
> >
> > Correct. You can also apply it to a particular method to have
> > per-method adjustment. In fact, @Timeout is somewhat redundant since
> > @Test also has a "timeout" attribute... and this will also work. But I
> > thought a consistent @Timeout would be nicer (applied to class,
> > method, wherever). Up to your taste I guess.
> >
> > There is one issue with timeouts -- they apply to test cases _only_,
> > not to suite-level code (@BeforeClass, @ClassRules). I don't know if
> > this qualifies as a bug or feature -- haven't developed that gut
> > feeing yet...
> >
> > Dawid
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: dev-help@lucene.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>

Re: hudson hung

Posted by Michael McCandless <lu...@mikemccandless.com>.
Hmm, as a test, I tried adding @Timeout(millis=100000) to
LuceneTestCase, ie 100 seconds, which I think should not trigger on
any core tests today.

That should then apply to all subclasses of LuceneTestCase right?  Ie
all tests will be aborted after 100 seconds...

But, something is wrong: I get lots of quick (ie much less than 100
seconds) failures like this:

   [junit4] Suite: org.apache.lucene.util.TestRamUsageEstimatorOnWildAnimals
   [junit4] ERROR   0.00s J2 | TestRamUsageEstimatorOnWildAnimals (suite)
   [junit4]    > Throwable #1: java.lang.RuntimeException: Interrupted
while waiting for worker? Weird.
   [junit4]    > 	at __randomizedtesting.SeedInfo.seed([329191043FC42BEA]:0)
   [junit4]    > 	at
com.carrotsearch.randomizedtesting.RandomizedRunner.runAndWait(RandomizedRunner.java:786)
   [junit4]    > 	at
com.carrotsearch.randomizedtesting.RandomizedRunner.access$900(RandomizedRunner.java:131)
   [junit4]    > 	at
com.carrotsearch.randomizedtesting.RandomizedRunner$3.evaluate(RandomizedRunner.java:689)
   [junit4]    > 	at
com.carrotsearch.randomizedtesting.RandomizedRunner$4.evaluate(RandomizedRunner.java:723)
   [junit4]    > 	at
com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:734)
   [junit4]    > 	at
org.apache.lucene.util.UncaughtExceptionsRule$1.evaluate(UncaughtExceptionsRule.java:75)
   [junit4]    > 	at
org.apache.lucene.util.StoreClassNameRule$1.evaluate(StoreClassNameRule.java:38)
   [junit4]    > 	at
org.apache.lucene.util.SystemPropertiesInvariantRule$1.evaluate(SystemPropertiesInvariantRule.java:69)
   [junit4]    > 	at
com.carrotsearch.randomizedtesting.RandomizedRunner.runSuite(RandomizedRunner.java:604)
   [junit4]    > 	at
com.carrotsearch.randomizedtesting.RandomizedRunner.access$400(RandomizedRunner.java:131)
   [junit4]    > 	at
com.carrotsearch.randomizedtesting.RandomizedRunner$2.run(RandomizedRunner.java:550)
   [junit4]    > Caused by: java.lang.InterruptedException
   [junit4]    > 	at java.lang.Object.wait(Native Method)
   [junit4]    > 	at java.lang.Thread.join(Thread.java:1266)
   [junit4]    > 	at
com.carrotsearch.randomizedtesting.RandomizedRunner.runAndWait(RandomizedRunner.java:776)
   [junit4]    > 	... 10 more
   [junit4]    >
   [junit4] Completed on J2 in 0.34s, 1 test, 1 error <<< FAILURES!
   [junit4]
   [junit4] May 01, 2012 9:02:18 AM
com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus
dispatch
   [junit4] SEVERE: Could not dispatch event:
com.carrotsearch.ant.tasks.junit4.events.aggregated.AggregatedSuiteResultEvent@6637b753
to handler [wrapper public void
com.carrotsearch.ant.tasks.junit4.listeners.TextReport.onSuiteResult(com.carrotsearch.ant.tasks.junit4.events.aggregated.AggregatedSuiteResultEvent)]
   [junit4] java.lang.reflect.InvocationTargetException
   [junit4] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   [junit4] 	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   [junit4] 	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   [junit4] 	at java.lang.reflect.Method.invoke(Method.java:601)
   [junit4] 	at
com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:68)
   [junit4] 	at
com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
   [junit4] 	at
com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
   [junit4] 	at
com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
   [junit4] 	at
com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.post(EventBus.java:264)
   [junit4] 	at
com.carrotsearch.ant.tasks.junit4.events.aggregated.AggregatingListener.receiveSuiteEnd(AggregatingListener.java:130)
   [junit4] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   [junit4] 	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   [junit4] 	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   [junit4] 	at java.lang.reflect.Method.invoke(Method.java:601)
   [junit4] 	at
com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:68)
   [junit4] 	at
com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
   [junit4] 	at
com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
   [junit4] 	at
com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
   [junit4] 	at
com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.post(EventBus.java:264)
   [junit4] 	at
com.carrotsearch.ant.tasks.junit4.LocalSlaveStreamHandler.pumpEvents(LocalSlaveStreamHandler.java:139)
   [junit4] 	at
com.carrotsearch.ant.tasks.junit4.LocalSlaveStreamHandler$1.run(LocalSlaveStreamHandler.java:81)
   [junit4] 	at java.lang.Thread.run(Thread.java:722)
   [junit4] Caused by: java.lang.RuntimeException: Unfinished
test?org.apache.lucene.util.TestRamUsageEstimatorOnWildAnimals,
testOverflowMaxChainLength(org.apache.lucene.util.TestRamUsageEstimatorOnWildAnimals)
   [junit4] 	at
com.carrotsearch.ant.tasks.junit4.events.aggregated.AggregatedTestResultEvent.getEventStream(AggregatedTestResultEvent.java:87)
   [junit4] 	at
com.carrotsearch.ant.tasks.junit4.listeners.TextReport.format(TextReport.java:411)
   [junit4] 	at
com.carrotsearch.ant.tasks.junit4.listeners.TextReport.onSuiteResult(TextReport.java:216)
   [junit4] 	... 22 more

Not sure what's up...

Mike McCandless

http://blog.mikemccandless.com

On Mon, Apr 30, 2012 at 6:24 PM, Dawid Weiss
<da...@cs.put.poznan.pl> wrote:
>> just to clarify: your'e saying that if we put that anotation on a class,
>> like LuceneTestCase, it will apply to any test *method* in that class (or
>> subclasses) ... and presumably if a subclass uses that anotation with a
>> diff millis value, that will override the superclass.
>
> Correct. You can also apply it to a particular method to have
> per-method adjustment. In fact, @Timeout is somewhat redundant since
> @Test also has a "timeout" attribute... and this will also work. But I
> thought a consistent @Timeout would be nicer (applied to class,
> method, wherever). Up to your taste I guess.
>
> There is one issue with timeouts -- they apply to test cases _only_,
> not to suite-level code (@BeforeClass, @ClassRules). I don't know if
> this qualifies as a bug or feature -- haven't developed that gut
> feeing yet...
>
> Dawid
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: hudson hung

Posted by Dawid Weiss <da...@cs.put.poznan.pl>.
> just to clarify: your'e saying that if we put that anotation on a class,
> like LuceneTestCase, it will apply to any test *method* in that class (or
> subclasses) ... and presumably if a subclass uses that anotation with a
> diff millis value, that will override the superclass.

Correct. You can also apply it to a particular method to have
per-method adjustment. In fact, @Timeout is somewhat redundant since
@Test also has a "timeout" attribute... and this will also work. But I
thought a consistent @Timeout would be nicer (applied to class,
method, wherever). Up to your taste I guess.

There is one issue with timeouts -- they apply to test cases _only_,
not to suite-level code (@BeforeClass, @ClassRules). I don't know if
this qualifies as a bug or feature -- haven't developed that gut
feeing yet...

Dawid

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org