-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Resolves #1365 #1569
Resolves #1365 #1569
Conversation
@@ -346,7 +345,7 @@ protected final void runLeaf(Statement statement, Description description, | |||
EachTestNotifier eachNotifier = new EachTestNotifier(notifier, description); | |||
eachNotifier.fireTestStarted(); | |||
try { | |||
statement.evaluate(); |
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 wonder if instead of updating runLeaf()
we should update methodBlock()
to return a Statement
that calls Thread.interrupted()
at the end of the statement chain.
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 almost certainly modify classBlock()
to return a Statement
that calls Thread.interrupted()
at the end of the statement chain.
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.
@kcooney All right. I am looking into it.
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.
@kcooney Updated methodBlock()
to return a statement that clears interrupt status and reverted runLeaf
. I am not sure how updating classBlock()
will help?
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.
@npathai I assume that we would want to handle the case where the interrupt bit was set in a class rule or @AfterClass
method. Those are handled by classBlock()
@kcooney I have incorporated the review comments and cleared interrupt status flag from |
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.
Nice!
/** | ||
* @return a {@link Statement}: clears interrupt status of current thread after execution of statement | ||
*/ | ||
protected Statement withInterruptIsolation(final Statement statement) { |
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 personally would prefer this is be final
@kcooney Yes I agree. Made the method |
@npathai we usually do a squash and merge unless the author asks us to keep the commits separate. If you think these changes should be broken up a certain way on the main branch, please squash them. |
@kcooney I have squashed the commits. But Travis build for openjdk-6 failed, I am not sure why. |
Here are the logs:
|
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.
Sorry, noticed some minor problems.
We should file a separate issue about the broken openjdk6 build.
…classBlock() and methodBlock(). The flag is cleared after each test case completes and after AfterClass/ClassRule are executed
@kcooney All done. Raised issue for failing openjdk-6 build as well. Once merged I will update the release notes. |
@kcooney This should make it into 4.13, right? |
@marcphilipp your call. |
@npathai Please rebase your branch onto |
It would be great to get this in so the long awaited 4.13 can be released. :) |
Since this PR seems to have stalled, I've resubmitted the changes in #1586. |
@marcphilipp Apologies, I was away for some time so couldn't reply. |
Resolves #1365
runLeaf
method ofParentRunner
clears the interrupt status flag after execution of each test