in junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTestTask.java [76:108]
public void execute() {
try {
throwableCollector = taskContext.getThrowableCollectorFactory().create();
prepare();
if (throwableCollector.isEmpty()) {
checkWhetherSkipped();
}
if (throwableCollector.isEmpty() && !skipResult.isSkipped()) {
executeRecursively();
}
if (context != null) {
cleanUp();
}
reportCompletion();
}
finally {
// Ensure that the 'interrupted status' flag for the current thread
// is cleared for reuse of the thread in subsequent task executions.
// See https://github.com/junit-team/junit5/issues/1688
if (Thread.interrupted()) {
logger.debug(() -> String.format(
"Execution of TestDescriptor with display name [%s] "
+ "and unique ID [%s] failed to clear the 'interrupted status' flag for the "
+ "current thread. JUnit has cleared the flag, but you may wish to investigate "
+ "why the flag was not cleared by user code.",
this.testDescriptor.getDisplayName(), this.testDescriptor.getUniqueId()));
}
}
// Clear reference to context to allow it to be garbage collected.
// See https://github.com/junit-team/junit5/issues/1578
context = null;
}