Skip to content

Fix StackTrace printing when multiple exceptions occur (#1238)#1359

Merged
kcooney merged 1 commit into
junit-team:masterfrom
jacobrh91:master
Sep 17, 2016
Merged

Fix StackTrace printing when multiple exceptions occur (#1238)#1359
kcooney merged 1 commit into
junit-team:masterfrom
jacobrh91:master

Conversation

@jacobrh91

@jacobrh91 jacobrh91 commented Sep 14, 2016

Copy link
Copy Markdown
Contributor

I fixed the way MultipleFailureException prints the stacktraces. Now, when multiple exceptions are found, the stacktrace for each exception is printed

@marcphilipp

Copy link
Copy Markdown
Member

Who calls printStackTrace directly and why?

@kcooney

kcooney commented Sep 14, 2016

Copy link
Copy Markdown
Member

@marcphilipp apparently, we do: https://github.com/junit-team/junit4/search?utf8=%E2%9C%93&q=printStackTrace

The only call I see that could take in a MultipleFailureException is in Throwables which is used in a few places: https://github.com/junit-team/junit4/search?utf8=%E2%9C%93&q=Throwables.getStackTrace (so this pull would affect the output of org.junit.internal.TextListener which is used by JUnitCore.runMain())

@marcphilipp

Copy link
Copy Markdown
Member

Thanks for the pointer!

@kcooney Do you foresee this causing any issues?

@kcooney

kcooney commented Sep 16, 2016

Copy link
Copy Markdown
Member

@marcphilipp if users store these logs, then the log files could obviously get longer. The output might be hard to read, but if there are multiple failures then we should print something about each of them.

We might want to revisit trimming the stack traces in the future. Each of these traces would likely contain duplicate frames that include the guts of JUnit

@marcphilipp

Copy link
Copy Markdown
Member

I am in favor of merging this change.

@junit-team/junit-committers What do you guys think?

@stefanbirkner stefanbirkner left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kcooney kcooney merged commit 35c8fd3 into junit-team:master Sep 17, 2016
@kcooney

kcooney commented Sep 17, 2016

Copy link
Copy Markdown
Member

@jacobrh91 could you please update the release notes?

sebasjm pushed a commit to sebasjm/junit4 that referenced this pull request Mar 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants