You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Todd Lipcon (JIRA)" <ji...@codehaus.org> on 2012/10/06 00:18:37 UTC

[jira] (SUREFIRE-817) JUnit 4.7 test output is always buffered, lost if forked process exits abnormally

    [ https://jira.codehaus.org/browse/SUREFIRE-817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=310522#comment-310522 ] 

Todd Lipcon commented on SUREFIRE-817:
--------------------------------------

I spent some time looking into this, and it appears that it was fixed in Surefire 2.12.3, probably by one of the following commits:

{code}
commit 30f9991b6645ebb1520fdeb70addffe5c22a3938
Author: Kristian Rosenvold <kr...@apache.org>
Date:   Mon Aug 20 17:02:21 2012 +0000

    o Removed last remains of CDR
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/surefire/trunk@1375109 13f79535-47bb-0310-9956-ffa450edef68

commit f8cb5724b82cd5faec37f1d37f3fdc8dc2bb6643
Author: Kristian Rosenvold <kr...@apache.org>
Date:   Thu Aug 16 16:38:34 2012 +0000

    o Refactored all the duplicated shared state out of the reporters
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/surefire/trunk@1373909 13f79535-47bb-0310-9956-ffa450edef68

commit 22643d3b4c6ac6c2c3f0d48586924b3d8b3194f3
Author: Kristian Rosenvold <kr...@apache.org>
Date:   Tue Aug 14 14:29:32 2012 +0000

    o Worked on simplifying the reporting stuff
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/surefire/trunk@1372903 13f79535-47bb-0310-9956-ffa450edef68
{code}

Given that, I'm inclined to resolve this JIRA. Agreed?
                
> JUnit 4.7 test output is always buffered, lost if forked process exits abnormally
> ---------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-817
>                 URL: https://jira.codehaus.org/browse/SUREFIRE-817
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.7+ (parallel) support
>    Affects Versions: 2.11
>            Reporter: Todd Lipcon
>
> The junit47 provider and above support multi-threaded test execution, and thus interpose a buffering layer (ConcurrentReporterManager) in between the test output and the actual stderr/stdout. This is ostensibly to allow the multiple threads' stderr and stdout to be demuxed nicely when the suite completes. But, if the JVM exits abnormally (eg due to a segfault or a System.exit() call), no output is generated. This is problematic since it's very hard to debug the test failure!
> In my opinion, the buffering layer should only be interposed _when parallel running is enabled_. For the non-parallel case, there's no need to buffer the output. A simple test case is to write a JUnit test which prints a line of output to stderr and then calls System.exit(1). The output doesn't show up anywhere.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira