From 60eca4b7f34b04b127a9297037096ca47857425d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Fri, 19 Jan 2024 14:30:22 +0100 Subject: [PATCH] Disable testhost prestart (#4833) (#4836) * Disable testhost prestart * Fix test --- .../Client/Parallel/ParallelOperationManager.cs | 2 +- .../Client/Parallel/ParallelProxyExecutionManagerTests.cs | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs index d1374c7e25..df2ef9133a 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/Parallel/ParallelOperationManager.cs @@ -18,7 +18,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)), diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelProxyExecutionManagerTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/Parallel/ParallelProxyExecutionManagerTests.cs index 3e1e4bab0f..061e6c00a2 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]