You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Falko Modler (JIRA)" <ji...@codehaus.org> on 2012/06/26 23:29:21 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=301936#comment-301936 ] 

Falko Modler commented on SUREFIRE-817:
---------------------------------------

Runtime.getRuntime().addShutdownHook(...) might worth a look.

I also strongly support that:
"the buffering layer should only be interposed when parallel running is enabled"
                
> 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