-
Notifications
You must be signed in to change notification settings - Fork 873
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
JAVA-3117: Call CcmCustomRule#after if CcmCustomRule#before fails to … #1720
Conversation
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.
You forgot to do the same for after
try { | ||
after(); | ||
} catch (Exception e1) { | ||
LOG.warn("Error cleaning up CustomCcmRule before() failure", e1); |
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.
LOG.warn("Error cleaning up CustomCcmRule before() failure", e1); | |
LOG.warn("Error cleaning up CustomCcmRule before() failure", e1); | |
e.addSuppressed(e1); |
Wrapping |
it |
👍 I think I see what you mean ( |
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.
👍 we should merge this and do a follow on to address the two comments.
@tolbertam , @hhughes @lukasz-antoniak, ok, let's merge it i will create a follow up PR |
LOG.warn( | ||
"Error in CustomCcmRule before() method, attempting to clean up leftover state", e); | ||
try { | ||
after(); |
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.
Another question, will it break RuleChain
sequence ?
Meaning if CustomCcmRule
is part of the RuleChain
:
CustomCcmRule
, Rule#1
then RuleChain.before
calls CustomCcmRule.before
and then Rule#1.before
when test or any rule fails it is going to call:
RuleChain.after
which is going to call Rule#1.after
and only then CustomCcmRule.after
.
If you do call after()
here it changes the sequence and can cause unexpected consuquences.
Or maybe I can create a new PR to address it. |
@dkropachev sounds good; I'll merge this as is shortly to pick up @hhughes's contribution and if you could follow up with a PR with the suggested additions that would be great. |
…allow subsequent tests to run patch by Henry Hughes; reviewed by Alexandre Dutra and Andy Tolbert for JAVA-3117
3b13925
to
ff17f6b
Compare
merged, I'll keep my eye out for your PR @dkropachev 👍 |
It is a valid point. However, tests usually run 👍 for attempting to handle failures of To justify merging this PR - it will still greatly reduce situation when single |
…allow subsequent tests to run