diff --git a/src/Adapter/MSTest.TestAdapter/Execution/TestAssemblyInfo.cs b/src/Adapter/MSTest.TestAdapter/Execution/TestAssemblyInfo.cs index ca497a33da..9e688e720c 100644 --- a/src/Adapter/MSTest.TestAdapter/Execution/TestAssemblyInfo.cs +++ b/src/Adapter/MSTest.TestAdapter/Execution/TestAssemblyInfo.cs @@ -287,7 +287,7 @@ internal void ExecuteAssemblyCleanup(TestContext testContext) AssemblyCleanupMethod.InvokeAsSynchronousTask(null, testContext); } }, - new CancellationTokenSource(), + testContext.CancellationTokenSource, AssemblyCleanupMethodTimeoutMilliseconds, AssemblyCleanupMethod, new AssemblyExecutionContextScope(isCleanup: true), diff --git a/src/Adapter/MSTest.TestAdapter/Execution/TestClassInfo.cs b/src/Adapter/MSTest.TestAdapter/Execution/TestClassInfo.cs index b5ba1db38d..1fcf49697a 100644 --- a/src/Adapter/MSTest.TestAdapter/Execution/TestClassInfo.cs +++ b/src/Adapter/MSTest.TestAdapter/Execution/TestClassInfo.cs @@ -765,7 +765,7 @@ void DoRun() methodInfo.InvokeAsSynchronousTask(null, testContext); } }, - new CancellationTokenSource(), + testContext.CancellationTokenSource, timeout, methodInfo, new ClassExecutionContextScope(ClassType, remainingCleanupCount),