-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Issue 3054 avoiding inclusion of the suppressed PreconditionViolation… #4439
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
base: main
Are you sure you want to change the base?
Conversation
…Exception in the stacktrace
I've added a test in cb3d5d6. |
try { | ||
stream.close(); | ||
} | ||
catch (Throwable t2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should generally discard all Throwables
thrown from providers' onClose
callbacks. The exception could contain an important hint so adding it as a suppressed exception could be useful. Therefore, I think we should introduce a custom TemplateInvocationValidationException
(in org.junit.jupiter.api.extension
) that extends JUnitException
and throw it from here:
Lines 51 to 52 in c4faa6c
Preconditions.condition(invocationCount.get() > 0 || declarationContext.isAllowingZeroInvocations(), | |
() -> String.format("Configuration error: You must configure at least one set of arguments for this @%s", declarationContext.getAnnotationName()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BassemElMasry Do you have time to make the change or should I take it from here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @marcphilipp , I can finalize it this week. Sorry I did not see the comments earlier. If this is not feasible for you, feel free to finalize it of course.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries! Finalizing it this week is fine, please go ahead! 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @marcphilipp unfortunately I had another medical emergency and just came out of the hospital yesterday. Can you please take care of this as I am very sick? 😭 I am so sorry for the delay I caused.
…Exception in the stacktrace
Overview
This PR is aimed to resolve the issue described here Issue 3054
Shall we include a test under
ParameterizedTestIntegrationTests
to ensure that suppressed exceptions are not included? I have tried but could not replicate the exact issue mentioned for static initializer so maybe we can take another approach like violating a specific PreCondition and ensure that the default one under the stream.close is not included in the suppressed exceptions.I hereby agree to the terms of the JUnit Contributor License Agreement.
Definition of Done
@API
annotations