Introduce support for cancelling a running execution to the Launcher API #4728
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This commit introduces
CancellationToken
that can be created andpassed to the
Launcher
as part of aLauncherExecutionRequest
. TheLauncher
checks whether cancellation has been requested on the tokenprior to asking each test engine to execute tests. If cancellation has
been requested, the
Launcher
reports all direct children of enginedescriptors as skipped. Moreover, it passes the
CancellationToken
toeach engine so they can check and respond to cancellation as well which
will be implemented separately as indicated by TODO comments.
EngineTestKit
also supports passing aCancellationToken
to theengine under test.
The documentation now contains an example for implementing a fail-fast
listener and documents the additional requirement for test engines that
wish to support cancellation.
Resolves #1880.
I hereby agree to the terms of the JUnit Contributor License Agreement.
Definition of Done
@API
annotations