You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Jason Hoogland <ho...@gmail.com> on 2013/04/16 15:59:37 UTC

switching junit standard output buffering off?

If the jvm during junit tests forks abnormally, standard output won;t be
shown becaused its buffered.  Apparently this can be switched off (e.g.
http://comments.gmane.org/gmane.comp.apache.maven.issues/28714,
http://grokbase.com/t/hadoop/zookeeper-user/10b4h71k09/junit-tests-do-not-produce-logs-if-the-jvm-crashes
).

Any ideas on whether/how this might be done with buildr?

hoogs

Re: switching junit standard output buffering off?

Posted by Jason Hoogland <ho...@gmail.com>.
Peter,

Yes have observed, but I removed the problem by replacing System.exit
statements in the java with exceptions.  But thanks for the tip.

hoogs


On Wed, Apr 17, 2013 at 11:27 AM, Peter Donald <pe...@realityforge.org>wrote:

> On Tue, Apr 16, 2013 at 11:59 PM, Jason Hoogland <ho...@gmail.com>
> wrote:
> > If the jvm during junit tests forks abnormally, standard output won;t be
> > shown becaused its buffered.  Apparently this can be switched off (e.g.
> > http://comments.gmane.org/gmane.comp.apache.maven.issues/28714,
> >
> http://grokbase.com/t/hadoop/zookeeper-user/10b4h71k09/junit-tests-do-not-produce-logs-if-the-jvm-crashes
> > ).
> >
> > Any ideas on whether/how this might be done with buildr?
>
> Have you observed buffering in Buildr? I would not have thought this
> is a problem with the Junit integration built in as it uses the
> default reports and not any of the ones the buffering. Even if that
> was the cvase you can pass system properties and jvm parameters to the
> test JVM that will control this behavior.
>
> test.using :properties => {"myvar" => "x"}, :java_args => :{"myvar" => "x"}
>
>
>
> --
> Cheers,
>
> Peter Donald
>

Re: switching junit standard output buffering off?

Posted by Peter Donald <pe...@realityforge.org>.
On Tue, Apr 16, 2013 at 11:59 PM, Jason Hoogland <ho...@gmail.com> wrote:
> If the jvm during junit tests forks abnormally, standard output won;t be
> shown becaused its buffered.  Apparently this can be switched off (e.g.
> http://comments.gmane.org/gmane.comp.apache.maven.issues/28714,
> http://grokbase.com/t/hadoop/zookeeper-user/10b4h71k09/junit-tests-do-not-produce-logs-if-the-jvm-crashes
> ).
>
> Any ideas on whether/how this might be done with buildr?

Have you observed buffering in Buildr? I would not have thought this
is a problem with the Junit integration built in as it uses the
default reports and not any of the ones the buffering. Even if that
was the cvase you can pass system properties and jvm parameters to the
test JVM that will control this behavior.

test.using :properties => {"myvar" => "x"}, :java_args => :{"myvar" => "x"}



-- 
Cheers,

Peter Donald