Pretty cool technique... never have done mvn in a loop like that...but I
think I will. ☺️

On Sun, Jan 6, 2019, 12:47 PM David Blevins <[email protected] wrote:

> > On Jan 6, 2019, at 2:25 AM, Doychin Bondzhev <[email protected]>
> wrote:
> >
> > I would like to investigate this issue:
> https://issues.apache.org/jira/browse/TOMEE-2403
> >
> > Where I can get more detailed error log regarding this issue?
> >
> > I tried to run the test locally but it works.
>
> Here's a technique I use sometimes to check random failures:
>
>     $ for n in {1..50}; do mvn clean install
> -Dtest=AutoConnectionTrackerTest 2>&1 | tee run-$n.log; done
>
> So far 3 out 17 have failed.  Debugging them will still be a pain in the
> butt, but at least there's some hope.
>
>
> My shallow observation is that the approach taken in the test itself looks
> conspicuous.  Particularly, I'd say this test is not "correct" until it can
> pass without the System.gc() statements.
>
>  -
> https://github.com/apache/tomee/blob/master/container/openejb-core/src/test/java/org/apache/openejb/resource/AutoConnectionTrackerTest.java#L197
>
> More importantly, this method is using thread sleeps and retries to wait
> for log output which *will* cause random failures.  We should have a
> discussion on if there is a better way to make this more deterministic.
>
>  -
> https://github.com/apache/tomee/blob/master/container/openejb-core/src/test/java/org/apache/openejb/resource/AutoConnectionTrackerTest.java#L216
>
> Testing log output can work, however the test logic is ultimately "if you
> do or don't see this message in n seconds, we're good."  It needs to be "if
> you do or don't see this message *when the test is over*, we're good."
>
> Since it's looking in log output, one way to do that might be to simply
> log a "test complete" statement (perhaps with a random number on it), and
> then wait for that in the log output.
>
>
> -David
>
>
>
>
>

Reply via email to