From f84ae19c46ba8b7e5ac290adc88b8d5c85c64ccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Thu, 15 Jun 2023 18:30:36 +0200 Subject: [PATCH 1/2] Disable pre-start to avoid exhausting CPU when there is no subscriber to socket --- .../Client/Parallel/ParallelOperationManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs index ff8e1058a7..ee8fa07f47 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs @@ -17,7 +17,7 @@ namespace Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client; /// internal sealed class ParallelOperationManager : IDisposable { - private const int PreStart = 2; + private const int PreStart = 0; private readonly static int VSTEST_HOSTPRESTART_COUNT = int.TryParse( Environment.GetEnvironmentVariable(nameof(VSTEST_HOSTPRESTART_COUNT)), From 83b13bb37420bea022611d8dfd78c9c433a0c01b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Thu, 15 Jun 2023 19:05:06 +0200 Subject: [PATCH 2/2] Revert change that was done for pre-start --- .../Client/Parallel/ParallelProxyExecutionManagerTests.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelProxyExecutionManagerTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelProxyExecutionManagerTests.cs index 86806f8158..1fda7f8d28 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelProxyExecutionManagerTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelProxyExecutionManagerTests.cs @@ -285,11 +285,7 @@ public void StartTestRunShouldProcessAllSourcesOnExecutionAbortsForAnySource() Assert.IsTrue(_executionCompleted.Wait(Timeout3Seconds), "Test run not completed."); - // Even though we start the test run for two sources, because of the current setup where - // we initialize a proxy if no more slots are available, we end up with abort notice being - // sent only to the running manager. This leaves the initialized manager in limbo and the - // assert will fail because of this. - Assert.AreEqual(1, _processedSources.Count, "Abort should stop all sources execution."); + Assert.AreEqual(2, _processedSources.Count, "Abort should stop all sources execution."); } [TestMethod]