In some cases, you would be spawning new threads from the Test Step to run background tasks/polling tasks, etc. while the actual test step runs.
Is there a mechanism to safely notify the thread that the user has requested an abort of the test plan run?
Yes, TapThread
class provides an AbortToken
of type System.Threading.CancellationToken
. You can pass this cancellation token to your threads and use the IsCancellationRequested
property or more advanced callback mechanisms present in the CancellationToken class