Share via


TimeoutAttribute.CooperativeCancellation Property

Definition

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

Property Value

Applies to