Todd Lipcon created SUREFIRE-817: ------------------------------------ Summary: 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