Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
A StackTraceWriter writes test failures and errors to stderr. The output is abbreviated to 78 characters and suffixed by three dots. It is often difficult if not impossible to quickly understand the test failure due to this abbreviation.
This JUnit test:
class FailingTest { @Test void throwsRTException() { throw new RuntimeException("123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789."); } }
results in following output:
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] FailingTest.throwsRTException:12 Runtime 123456789.123456789.123456789.1234567...
[INFO]
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
The abbreviation is done in class SmartStackTraceParser (and/or LegacyPojoStackTraceWriter). Both have:
MAX_LINE_LENGTH = 77
The actual output is 78 characters long
This behavior is true for all errors/failures except:
AssertionError, AssertionFailedError, ComparisonFailure and org.opentest4j.*
Why these should receive special treatment is not obvious.