Introduce PreInterruptCallback extension point#3431
Introduce PreInterruptCallback extension point#3431marcphilipp merged 3 commits intojunit-team:mainfrom
Conversation
|
I am currently not happy with the change in |
da26892 to
0c2a0ed
Compare
marcphilipp
left a comment
There was a problem hiding this comment.
I am currently not happy with the change in
MutableExtensionRegistry. Is there another way to get the current activeExtensionRegistryfrom a currentExtensionContext?
I think we should consider adding a <E extends Extension> List<E> getExtensions(Class<E> extensionType) method to ExtensionContext and storing an ExtensionRegistry as an instance field in the implementations of ExtensionContext. Could you please give that a try?
|
@marcphilipp Thanks for the review. And your proposal regarding the |
marcphilipp
left a comment
There was a problem hiding this comment.
Thanks for making the requested changes! I've requested one additional change and I'd like to discuss the introduction of ExtensionContext.getExtensions (that I suggested) with the team before we merge this.
marcphilipp
left a comment
There was a problem hiding this comment.
One more thing came out of our team discussion.
Added PreInterruptCallback extension to allow to hook into the @timeout extension before the executing Thread is interrupted. The default implementation of PreInterruptCallback will simply print the stacks of all Thread to System.out. It is disabled by default and must be enabled with: junit.jupiter.execution.timeout.threaddump.enabled = true Issue: junit-team#2938 Co-authored-by: Marc Philipp <mail@marcphilipp.de>
|
@AndreasTu Thank you for your contribution! 👍 |
Overview
Added PreInterruptCallback extension to allow to hook into the
@Timeoutextension before the executing Thread is interrupted.The default implementation of PreInterruptCallback will simply print the stacks of all Thread to System.out.
It is disabled by default and must be enabled with: junit.jupiter.execution.timeout.threaddump.enabled = true
Issue: #2938
I hereby agree to the terms of the JUnit Contributor License Agreement.
Definition of Done
@APIannotations