From c3463b47872f41dcf5b89d89e12a0861568dfb30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Thu, 18 Jan 2024 13:47:51 +0100 Subject: [PATCH 1/2] Disable testhost prestart --- .../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 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)), From 5798af2fbb3ccdbb27c7bee34380558f3f33ee3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Thu, 18 Jan 2024 15:07:41 +0100 Subject: [PATCH 2/2] Fix test --- .../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 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]