[
https://issues.apache.org/jira/browse/SUREFIRE-1226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16187122#comment-16187122
]
Stig Rohde Døssing commented on SUREFIRE-1226:
----------------------------------------------
[~tibor17] I'm more or less repeating what [~jglick] said, but
[[email protected]]'s expectation for trimStackTrace seems much more
reasonable to me than the new behavior. The post-2.19 behavior makes test
output misleading in some cases, and makes trimStackTrace much less useful,
especially when the trimmed stack trace doesn't indicate that it's been
trimmed.
In 2.18.1 I get the following trace with trimStackTrace enabled when I cause an
NPE in my code:
{code}
testCommitSuccessWithOffsetVoids(org.apache.storm.kafka.spout.KafkaSpoutCommitTest)
Time elapsed: 0.425 sec <<< ERROR!
java.lang.NullPointerException: null
at org.apache.storm.kafka.spout.KafkaSpout.commit(KafkaSpout.java:266)
at
org.apache.storm.kafka.spout.KafkaSpout.nextTuple(KafkaSpout.java:235)
at
org.apache.storm.kafka.spout.KafkaSpoutCommitTest.testCommitSuccessWithOffsetVoids(KafkaSpoutCommitTest.java:87)
{code}
This is short (no Surefirebooter or JUnit runner lines) but still perfectly
describes where the error occured. Since 2.19 trimStackTrace behavior has
changed to produce the following instead:
{code}
testCommitSuccessWithOffsetVoids(org.apache.storm.kafka.spout.KafkaSpoutCommitTest)
Time elapsed: 0.713 sec <<< ERROR!
java.lang.NullPointerException
at
org.apache.storm.kafka.spout.KafkaSpoutCommitTest.testCommitSuccessWithOffsetVoids(KafkaSpoutCommitTest.java:87)
{code}
which is much less useful. Not only does it now look like the NPE happened in
L87 of the test, which causes me to have to double check that there are no
nulls in that line, but I also can't tell which part of nextTuple may have
thrown the exception. In order to debug this I either have to blindly look
around nextTuple to see if I can figure it out, or I have to disable
trimStackTrace and live with all the extra lines in my stack traces.
> Surefire trims all stack trace elements except those in the test that failed
> ----------------------------------------------------------------------------
>
> Key: SUREFIRE-1226
> URL: https://issues.apache.org/jira/browse/SUREFIRE-1226
> Project: Maven Surefire
> Issue Type: Bug
> Components: Maven Surefire Plugin
> Affects Versions: 2.19
> Reporter: Jiri Locker
> Assignee: Tibor Digana
> Priority: Minor
> Attachments: mvn_stacktrace.tar.gz
>
>
> This looks like a re-occurrence of SUREFIRE-992 but now the stack trace is
> even more trimmed.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)