TimeoutAttribute.CooperativeCancellation Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value indicating whether the test method should be cooperatively canceled on timeout.
When set to true
, the cancellation token is canceled on timeout, and the method completion is awaited.
The test method and all the code it calls, must be designed in a way that it observes the cancellation and cancels
cooperatively. If the test method does not complete, the timeout does not force it to complete.
When set to false
, the cancellation token is canceled on timeout, timeout result is reported and the
method task will continue running on background. This may lead to conflicts in file access on test cleanup, unobserved
exceptions, and memory leaks.
public bool CooperativeCancellation { get; set; }
member this.CooperativeCancellation : bool with get, set
Public Property CooperativeCancellation As Boolean