From bf06a3c25a6a0d364fbddba67a5fa2fe7a265ca3 Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Tue, 14 Jan 2025 06:44:20 +0100 Subject: [PATCH] Fix test parallelization --- .../MSTest.TestAdapter/Execution/TestExecutionManager.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Adapter/MSTest.TestAdapter/Execution/TestExecutionManager.cs b/src/Adapter/MSTest.TestAdapter/Execution/TestExecutionManager.cs index 51f7e0b8bc..14823a4e32 100644 --- a/src/Adapter/MSTest.TestAdapter/Execution/TestExecutionManager.cs +++ b/src/Adapter/MSTest.TestAdapter/Execution/TestExecutionManager.cs @@ -86,7 +86,8 @@ private static Task DefaultFactoryAsync(Func taskGetter) } else { - return taskGetter(); + // NOTE: If you replace this with `return taskGetter()`, you will break parallel tests. + return Task.Run(taskGetter); } }