Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MultipleFailuresError loses exceptions in re-serialization scenarios #64

Open
vlsi opened this issue Feb 10, 2020 · 7 comments
Open

MultipleFailuresError loses exceptions in re-serialization scenarios #64

vlsi opened this issue Feb 10, 2020 · 7 comments

Comments

@vlsi
Copy link

vlsi commented Feb 10, 2020

Sometimes exceptions are passed through serialization, and it is not always the case that the receiver side has all the required classes to instantiate the exception.

For instance, when sending a SOAP response, one can't be sure that the receiver side would have opentest4j on the classpath.
In the same way, Gradle uses serialization to pass exceptions between daemon processes.
In those cases, the code uses standard APIs (e.g. getCause, getMessage, getStackTrace, ...) to snapshot the exception bits so it would be able to pass at least something meaningful.
MultipleFailuresError does not expose causes via standard APIs, and it causes missing information in the test outputs.

Note: Gradle (as of 6.1.1) results in creating a PlaceholderException instead of MultipleFailuresError.

Of course, Gradle does not know it must call MultipleFailuresError#getFailures to get the causes.

Suggestion: do something (e.g. addSuppressed) so the cause exceptions can be received via standard Java APIs.

Note: if you can't bump minimal Java to 1.7, you might consider SQLException#setNextException. For instance, you might add a dummy wrapper SQLException to the cause of MultipleFailuresError.

@marcphilipp
Copy link
Member

+1 for bumping to 1.7 and calling addSuppressed.

@sormuras
Copy link
Member

+1 for bumping -- why not directly to Java 8?

@vlsi
Copy link
Author

vlsi commented Feb 10, 2020

Well, I just saw you have 1.6, so 1.7 was a conservative suggestion.

On the other hand, both 1.7 and 1.8 are probably OK for me.

@vlsi
Copy link
Author

vlsi commented Feb 10, 2020

@sbrannen
Copy link
Member

+1 for bumping to 1.7 and calling addSuppressed.

So then.... OpenTest4J 2.0.0 ?

@marcphilipp
Copy link
Member

I guess so.

@marcphilipp
Copy link
Member

@vlsi Would you be interested in submitting a PR?

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

No branches or pull requests

4 participants