Skip to content

Commit aabe9eb

Browse files
authored
Avoid creation of tasks (#3282)
1 parent 7f288a9 commit aabe9eb

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/Adapter/MSTest.TestAdapter/Execution/TestClassInfo.cs

+2-4
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,7 @@ internal UnitTestResult GetResultOrRunClassInitialize(ITestContext testContext,
384384

385385
try
386386
{
387-
var threadTask = Task.Run(entryPointThread.Join);
388-
threadTask.Wait();
387+
entryPointThread.Join();
389388
return result;
390389
}
391390
catch (Exception ex)
@@ -667,8 +666,7 @@ internal void RunClassCleanup(ITestContext testContext, ClassCleanupManager clas
667666

668667
try
669668
{
670-
var threadTask = Task.Run(entryPointThread.Join);
671-
threadTask.Wait();
669+
entryPointThread.Join();
672670
}
673671
catch (Exception ex)
674672
{

src/Adapter/MSTest.TestAdapter/Execution/TestMethodRunner.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ internal UnitTestResult[] Execute(string initializationLogs, string initializati
8181

8282
try
8383
{
84-
var threadTask = Task.Run(entryPointThread.Join);
85-
threadTask.Wait();
84+
entryPointThread.Join();
8685
}
8786
catch (Exception ex)
8887
{

src/Adapter/MSTest.TestAdapter/VSTestAdapter/MSTestExecutor.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft Corporation. All rights reserved.
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

44
using System.Runtime.InteropServices;

0 commit comments

Comments
 (0)