From e8c829b2b9d2e97bd82446c231e952ba583ec31b Mon Sep 17 00:00:00 2001 From: Copilot <223556219+Copilot@users.noreply.github.com> Date: Sat, 16 May 2026 16:30:59 +0200 Subject: [PATCH] Fix TelemetryTests flake from parallel dotnet test races The VSTest_RunTests_Succeeds and VSTest_DiscoverTests_Succeeds tests both invoke `dotnet test` against the same shared VSTest project path for every target framework. Running them in parallel races on MSBuild outputs such as `bin/Release//TelemetryVSTestProject.runtimeconfig.json` and shared `obj/` files, which causes intermittent `GenerateRuntimeConfigurationFiles` failures (file in use). Apply `[DoNotParallelize]` at the class level to serialize all tests in TelemetryTests. Coverage is unchanged and the duration impact is small. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../MSTest.Acceptance.IntegrationTests/TelemetryTests.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TelemetryTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TelemetryTests.cs index b09a2e72cb..9d8fc98e34 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TelemetryTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TelemetryTests.cs @@ -8,6 +8,12 @@ namespace MSTest.Acceptance.IntegrationTests; [TestClass] +// The VSTest_* tests below invoke `dotnet test` against the same shared VSTest project +// path for every target framework. Running them in parallel races on MSBuild outputs +// such as `bin/Release//TelemetryVSTestProject.runtimeconfig.json` and shared +// `obj/` files, which causes intermittent `GenerateRuntimeConfigurationFiles` failures. +// Serialize all tests in this class to keep the suite deterministic. +[DoNotParallelize] public sealed class TelemetryTests : AcceptanceTestBase { private const string MTPAssetName = "TelemetryMTPProject";