You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by András Kövi <al...@gmail.com> on 2010/11/04 11:33:31 UTC

JUnit tests do not produce logs if the JVM crashes

Hi all, I'm new to Zookeeper and ran into an issue while trying to run the
tests with ant.

It seems like the log output is buffered until the complete test suite
finishes and it is flushed into its specific file only after then. I had to
make some changes to the code (no JNI or similar) that resulted in JVM
crashes. Since the logs are lost in this case, it is a little hard to debug
the issue.

Do you have any idea how I could disable the buffering?

Thanks,
Andras

Re: JUnit tests do not produce logs if the JVM crashes

Posted by András Kövi <al...@gmail.com>.
Thank you for the fast responses. I'll try them.

Regards,
Andras

2010/11/4 Patrick Hunt <ph...@apache.org>

> In addition to what Mahadev suggested you can also change the
> log4j.properties to log to a file rather than the CONSOLE. Although
> that just redirects the logs, if there is some output to stdout/stderr
> then junit buffering is still in play.
>
> Patrick
>
> On Thu, Nov 4, 2010 at 8:15 AM, Mahadev Konar <ma...@yahoo-inc.com>
> wrote:
> > Hi Andras,
> >  Junit unit will always buffer the logs unless you print it out to
> console.
> >
> > To do that, try running this
> >
> > ant test -Dtest.output=yes
> >
> > This will print out the logs to console as they are logged.
> >
> > Thanks
> > mahadev
> >
> >
> > On 11/4/10 3:33 AM, "András Kövi" <al...@gmail.com> wrote:
> >
> >> Hi all, I'm new to Zookeeper and ran into an issue while trying to run
> the
> >> tests with ant.
> >>
> >> It seems like the log output is buffered until the complete test suite
> >> finishes and it is flushed into its specific file only after then. I had
> to
> >> make some changes to the code (no JNI or similar) that resulted in JVM
> >> crashes. Since the logs are lost in this case, it is a little hard to
> debug
> >> the issue.
> >>
> >> Do you have any idea how I could disable the buffering?
> >>
> >> Thanks,
> >> Andras
> >>
> >
> >
>

Re: JUnit tests do not produce logs if the JVM crashes

Posted by Patrick Hunt <ph...@apache.org>.
In addition to what Mahadev suggested you can also change the
log4j.properties to log to a file rather than the CONSOLE. Although
that just redirects the logs, if there is some output to stdout/stderr
then junit buffering is still in play.

Patrick

On Thu, Nov 4, 2010 at 8:15 AM, Mahadev Konar <ma...@yahoo-inc.com> wrote:
> Hi Andras,
>  Junit unit will always buffer the logs unless you print it out to console.
>
> To do that, try running this
>
> ant test -Dtest.output=yes
>
> This will print out the logs to console as they are logged.
>
> Thanks
> mahadev
>
>
> On 11/4/10 3:33 AM, "András Kövi" <al...@gmail.com> wrote:
>
>> Hi all, I'm new to Zookeeper and ran into an issue while trying to run the
>> tests with ant.
>>
>> It seems like the log output is buffered until the complete test suite
>> finishes and it is flushed into its specific file only after then. I had to
>> make some changes to the code (no JNI or similar) that resulted in JVM
>> crashes. Since the logs are lost in this case, it is a little hard to debug
>> the issue.
>>
>> Do you have any idea how I could disable the buffering?
>>
>> Thanks,
>> Andras
>>
>
>

Re: JUnit tests do not produce logs if the JVM crashes

Posted by Mahadev Konar <ma...@yahoo-inc.com>.
Hi Andras,
  Junit unit will always buffer the logs unless you print it out to console.

To do that, try running this

ant test -Dtest.output=yes

This will print out the logs to console as they are logged.

Thanks
mahadev


On 11/4/10 3:33 AM, "András Kövi" <al...@gmail.com> wrote:

> Hi all, I'm new to Zookeeper and ran into an issue while trying to run the
> tests with ant.
> 
> It seems like the log output is buffered until the complete test suite
> finishes and it is flushed into its specific file only after then. I had to
> make some changes to the code (no JNI or similar) that resulted in JVM
> crashes. Since the logs are lost in this case, it is a little hard to debug
> the issue.
> 
> Do you have any idea how I could disable the buffering?
> 
> Thanks,
> Andras
>