From fb6e2719c8b31a17841864990951e5ecb32c6a3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Wed, 24 Jun 2026 10:43:19 +0200 Subject: [PATCH 1/4] Default MSTest parallelization to class level Change the default MSTestParallelizeScope from MethodLevel to ClassLevel in test/Directory.Build.props and remove the now-redundant [DoNotParallelize] attributes that guarded against intra-class method races. - Set default scope to ClassLevel (methods within a class run sequentially, classes run in parallel). - Remove all class-level [DoNotParallelize] and assembly-level [assembly: DoNotParallelize] attributes (54 occurrences). - Delete two AssemblyInfo.cs files that contained only the assembly attribute. - Remove orphaned comments that justified the removed attributes and collapse the blank lines they left behind. - Keep the two method-level [DoNotParallelize] attributes guarding tests that mutate the process current directory. - Leave all project-level MSTestParallelizeScope overrides (None/empty/ClassLevel) untouched. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- test/Directory.Build.props | 9 ++++++--- test/EndToEnd.Tests/GivenDotNetUsesMSBuild.cs | 2 -- .../GivenAnMSBuildSdkResolver.cs | 2 -- .../EndToEndToolTests.cs | 1 - .../ToolPackageDownloaderTests.cs | 1 - .../ToolPackageInstallerNugetCacheTests.cs | 1 - .../ToolPackageUninstallerTests.cs | 1 - .../AuthHandshakeMessageHandlerTests.cs | 5 ----- ...nACheckForUnsupportedWinMDReferencesMultiThreading.cs | 1 - .../GivenAGenerateBundleMultiThreading.cs | 1 - .../GivenAGenerateClsidMapMultiThreading.cs | 1 - .../GivenAGenerateDepsFileMultiThreading.cs | 1 - .../GivenAGenerateRuntimeConfigMultiThreading.cs | 1 - .../GivenAGenerateRuntimeConfigurationFiles.cs | 1 - .../GivenAGetPackagesToPrune.cs | 1 - .../GivenAPickBestRidMultiThreading.cs | 1 - .../GivenAResolveAppHostsMultiThreading.cs | 1 - .../GivenAResolvePackageAssetsMultiThreading.cs | 1 - .../GivenAResolvePackageFileConflictsMultiThreading.cs | 1 - .../GivenAResolveRuntimePackAssetsTask.cs | 1 - .../GivenATaskEnvironmentDefault.cs | 1 - .../GivenTasksUseAbsolutePaths.cs | 1 - .../EnvironmentHelperTests.cs | 1 - .../ServerCommandTest.cs | 4 ---- ...omputeStaticWebAssetsTargetPathsMultiThreadingTest.cs | 1 - .../CollectStaticWebAssetsToCopyMultiThreadingTest.cs | 3 --- ...ointsForReferenceStaticWebAssetsMultiThreadingTest.cs | 1 - .../DiscoverPrecompressedAssetsMultiThreadingTest.cs | 1 - .../GenerateStaticWebAssetsManifestMultiThreadingTest.cs | 3 --- ...GenerateStaticWebAssetsPropsFileMultiThreadingTest.cs | 3 --- .../MergeConfigurationPropertiesMultiThreadingTest.cs | 5 ----- .../ReadStaticWebAssetsManifestFileMultiThreadingTest.cs | 3 --- .../StaticWebAssetTaskEnvironmentTests.cs | 5 ----- ...ticWebAssetsGeneratePackManifestMultiThreadingTest.cs | 3 --- ...ebAssetsGeneratePackagePropsFileMultiThreadingTest.cs | 5 ----- .../UpdatePackageStaticWebAssetsMultiThreadingTest.cs | 3 --- .../GivenThatWeWantToPackAToolProject.cs | 4 ++-- .../GivenThatWeWantToPackAToolProjectWithPackagedShim.cs | 1 - .../PostActionTests/AddJsonPropertyPostActionTests.cs | 4 ---- .../dotnet-MsiInstallation.Tests/Framework/VMTestBase.cs | 1 - test/dotnet-aot.Tests/AssemblyInfo.cs | 7 ------- test/dotnet-format.UnitTests/AssemblyInfo.cs | 6 ------ .../CommandTests/MSBuild/DotnetMsbuildInProcTests.cs | 1 - .../CommandTests/MSBuild/GivenDotnetBuildInvocation.cs | 1 - .../CommandTests/MSBuild/GivenDotnetCleanInvocation.cs | 1 - .../MSBuild/GivenDotnetMSBuildBuildsProjects.cs | 3 --- .../CommandTests/MSBuild/GivenDotnetMSBuildInvocation.cs | 1 - .../CommandTests/MSBuild/GivenDotnetPackInvocation.cs | 1 - .../CommandTests/MSBuild/GivenDotnetPublishInvocation.cs | 1 - .../CommandTests/MSBuild/GivenDotnetRestoreInvocation.cs | 1 - .../CommandTests/MSBuild/GivenDotnetRunInvocation.cs | 1 - .../CommandTests/MSBuild/GivenDotnetStoreInvocation.cs | 1 - .../CommandTests/MSBuild/GivenDotnetTestInvocation.cs | 1 - .../CommandTests/Workload/List/GivenAnMsiInstallation.cs | 1 - .../GivenADotnetFirstTimeUseConfigurerWIthStateSetup.cs | 1 - test/dotnet.Tests/TelemetryTests/TelemetryCommandTest.cs | 1 - 56 files changed, 8 insertions(+), 108 deletions(-) delete mode 100644 test/dotnet-aot.Tests/AssemblyInfo.cs delete mode 100644 test/dotnet-format.UnitTests/AssemblyInfo.cs diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 092cdb3ee0b3..a38c572c87d2 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -28,9 +28,12 @@ - - MethodLevel + + ClassLevel Recommended diff --git a/test/EndToEnd.Tests/GivenDotNetUsesMSBuild.cs b/test/EndToEnd.Tests/GivenDotNetUsesMSBuild.cs index f6e6db76c592..d88f65237199 100644 --- a/test/EndToEnd.Tests/GivenDotNetUsesMSBuild.cs +++ b/test/EndToEnd.Tests/GivenDotNetUsesMSBuild.cs @@ -3,8 +3,6 @@ #nullable disable -[assembly: DoNotParallelize] - namespace EndToEnd.Tests { [TestClass] diff --git a/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenAnMSBuildSdkResolver.cs b/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenAnMSBuildSdkResolver.cs index d6bfff779bd8..32645c9ebfe1 100644 --- a/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenAnMSBuildSdkResolver.cs +++ b/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenAnMSBuildSdkResolver.cs @@ -7,8 +7,6 @@ using Microsoft.DotNet.DotNetSdkResolver; using Microsoft.DotNet.MSBuildSdkResolver; -[assembly: DoNotParallelize] - namespace Microsoft.DotNet.Cli.Utils.Tests { [TestClass] diff --git a/test/Microsoft.DotNet.PackageInstall.Tests/EndToEndToolTests.cs b/test/Microsoft.DotNet.PackageInstall.Tests/EndToEndToolTests.cs index 03c761a7e026..75786a86c338 100644 --- a/test/Microsoft.DotNet.PackageInstall.Tests/EndToEndToolTests.cs +++ b/test/Microsoft.DotNet.PackageInstall.Tests/EndToEndToolTests.cs @@ -8,7 +8,6 @@ namespace Microsoft.DotNet.PackageInstall.Tests { - [DoNotParallelize] [TestClass] public class EndToEndToolTests : SdkTest { diff --git a/test/Microsoft.DotNet.PackageInstall.Tests/ToolPackageDownloaderTests.cs b/test/Microsoft.DotNet.PackageInstall.Tests/ToolPackageDownloaderTests.cs index ea86828562d4..455b84955e4e 100644 --- a/test/Microsoft.DotNet.PackageInstall.Tests/ToolPackageDownloaderTests.cs +++ b/test/Microsoft.DotNet.PackageInstall.Tests/ToolPackageDownloaderTests.cs @@ -34,7 +34,6 @@ public DotnetEnvironmentTestFixture() public void Dispose() => Environment.SetEnvironmentVariable(_PATH_VAR_NAME, _originalPath); } - [DoNotParallelize] [TestClass] public class ToolPackageDownloaderTests : SdkTest { diff --git a/test/Microsoft.DotNet.PackageInstall.Tests/ToolPackageInstallerNugetCacheTests.cs b/test/Microsoft.DotNet.PackageInstall.Tests/ToolPackageInstallerNugetCacheTests.cs index 47ee66404e2e..13745f356bfc 100644 --- a/test/Microsoft.DotNet.PackageInstall.Tests/ToolPackageInstallerNugetCacheTests.cs +++ b/test/Microsoft.DotNet.PackageInstall.Tests/ToolPackageInstallerNugetCacheTests.cs @@ -14,7 +14,6 @@ namespace Microsoft.DotNet.PackageInstall.Tests { - [DoNotParallelize] [TestClass] public class ToolPackageInstallToManagedLocationInstaller : SdkTest { diff --git a/test/Microsoft.DotNet.PackageInstall.Tests/ToolPackageUninstallerTests.cs b/test/Microsoft.DotNet.PackageInstall.Tests/ToolPackageUninstallerTests.cs index 4e39c57e020a..53eafb2fc343 100644 --- a/test/Microsoft.DotNet.PackageInstall.Tests/ToolPackageUninstallerTests.cs +++ b/test/Microsoft.DotNet.PackageInstall.Tests/ToolPackageUninstallerTests.cs @@ -15,7 +15,6 @@ namespace Microsoft.DotNet.PackageInstall.Tests { - [DoNotParallelize] [TestClass] public class ToolPackageUninstallerTests : SdkTest { diff --git a/test/Microsoft.NET.Build.Containers.UnitTests/AuthHandshakeMessageHandlerTests.cs b/test/Microsoft.NET.Build.Containers.UnitTests/AuthHandshakeMessageHandlerTests.cs index 2f8d256769d8..06251b815f0b 100644 --- a/test/Microsoft.NET.Build.Containers.UnitTests/AuthHandshakeMessageHandlerTests.cs +++ b/test/Microsoft.NET.Build.Containers.UnitTests/AuthHandshakeMessageHandlerTests.cs @@ -10,11 +10,6 @@ namespace Microsoft.NET.Build.Containers.UnitTests { [TestClass] - // These tests mutate process-global environment variables (REGISTRY_AUTH_FILE and the - // registry credential vars) and rely on AuthHandshakeMessageHandler's static auth-header - // cache keyed by a shared registry name. Under MSTest method-level parallelism (the repo - // default) the methods/data rows race on that global state, so run them sequentially. - [DoNotParallelize] public class AuthHandshakeMessageHandlerTests { public TestContext TestContext { get; set; } = default!; diff --git a/test/Microsoft.NET.Build.Tasks.Tests/GivenACheckForUnsupportedWinMDReferencesMultiThreading.cs b/test/Microsoft.NET.Build.Tasks.Tests/GivenACheckForUnsupportedWinMDReferencesMultiThreading.cs index 9e77574cd496..59134db2a477 100644 --- a/test/Microsoft.NET.Build.Tasks.Tests/GivenACheckForUnsupportedWinMDReferencesMultiThreading.cs +++ b/test/Microsoft.NET.Build.Tasks.Tests/GivenACheckForUnsupportedWinMDReferencesMultiThreading.cs @@ -5,7 +5,6 @@ namespace Microsoft.NET.Build.Tasks.UnitTests { - [DoNotParallelize] [TestClass] public class GivenACheckForUnsupportedWinMDReferencesMultiThreading { diff --git a/test/Microsoft.NET.Build.Tasks.Tests/GivenAGenerateBundleMultiThreading.cs b/test/Microsoft.NET.Build.Tasks.Tests/GivenAGenerateBundleMultiThreading.cs index 19f5809b8e82..64ef380b82b2 100644 --- a/test/Microsoft.NET.Build.Tasks.Tests/GivenAGenerateBundleMultiThreading.cs +++ b/test/Microsoft.NET.Build.Tasks.Tests/GivenAGenerateBundleMultiThreading.cs @@ -22,7 +22,6 @@ namespace Microsoft.NET.Build.Tasks.UnitTests /// location different from the TaskEnvironment.ProjectDirectory so a bug that fell /// back to Environment.CurrentDirectory / Path.GetFullPath would surface here. /// - [DoNotParallelize] [TestClass] public class GivenAGenerateBundleMultiThreading : IDisposable { diff --git a/test/Microsoft.NET.Build.Tasks.Tests/GivenAGenerateClsidMapMultiThreading.cs b/test/Microsoft.NET.Build.Tasks.Tests/GivenAGenerateClsidMapMultiThreading.cs index 54fa48dfd754..e0cc49e6c6f0 100644 --- a/test/Microsoft.NET.Build.Tasks.Tests/GivenAGenerateClsidMapMultiThreading.cs +++ b/test/Microsoft.NET.Build.Tasks.Tests/GivenAGenerateClsidMapMultiThreading.cs @@ -6,7 +6,6 @@ namespace Microsoft.NET.Build.Tasks.UnitTests { - [DoNotParallelize] [TestClass] public class GivenAGenerateClsidMapMultiThreading { diff --git a/test/Microsoft.NET.Build.Tasks.Tests/GivenAGenerateDepsFileMultiThreading.cs b/test/Microsoft.NET.Build.Tasks.Tests/GivenAGenerateDepsFileMultiThreading.cs index 8cb908ac5ba1..1a59da340836 100644 --- a/test/Microsoft.NET.Build.Tasks.Tests/GivenAGenerateDepsFileMultiThreading.cs +++ b/test/Microsoft.NET.Build.Tasks.Tests/GivenAGenerateDepsFileMultiThreading.cs @@ -12,7 +12,6 @@ namespace Microsoft.NET.Build.Tasks.UnitTests { - [DoNotParallelize] [TestClass] public class GivenAGenerateDepsFilePathResolution : IDisposable { diff --git a/test/Microsoft.NET.Build.Tasks.Tests/GivenAGenerateRuntimeConfigMultiThreading.cs b/test/Microsoft.NET.Build.Tasks.Tests/GivenAGenerateRuntimeConfigMultiThreading.cs index 77a5547bc63c..1eb6e85b6f5b 100644 --- a/test/Microsoft.NET.Build.Tasks.Tests/GivenAGenerateRuntimeConfigMultiThreading.cs +++ b/test/Microsoft.NET.Build.Tasks.Tests/GivenAGenerateRuntimeConfigMultiThreading.cs @@ -7,7 +7,6 @@ namespace Microsoft.NET.Build.Tasks.UnitTests { - [DoNotParallelize] [TestClass] public class GivenAGenerateRuntimeConfigMultiThreading { diff --git a/test/Microsoft.NET.Build.Tasks.Tests/GivenAGenerateRuntimeConfigurationFiles.cs b/test/Microsoft.NET.Build.Tasks.Tests/GivenAGenerateRuntimeConfigurationFiles.cs index 851526592619..200909e72c16 100644 --- a/test/Microsoft.NET.Build.Tasks.Tests/GivenAGenerateRuntimeConfigurationFiles.cs +++ b/test/Microsoft.NET.Build.Tasks.Tests/GivenAGenerateRuntimeConfigurationFiles.cs @@ -3,7 +3,6 @@ namespace Microsoft.NET.Build.Tasks.UnitTests { - [DoNotParallelize] [TestClass] public class GivenAGenerateRuntimeConfigurationFiles { diff --git a/test/Microsoft.NET.Build.Tasks.Tests/GivenAGetPackagesToPrune.cs b/test/Microsoft.NET.Build.Tasks.Tests/GivenAGetPackagesToPrune.cs index b9a626fd6463..b17e81a93cef 100644 --- a/test/Microsoft.NET.Build.Tasks.Tests/GivenAGetPackagesToPrune.cs +++ b/test/Microsoft.NET.Build.Tasks.Tests/GivenAGetPackagesToPrune.cs @@ -13,7 +13,6 @@ namespace Microsoft.NET.Build.Tasks.UnitTests /// the task reads the on-disk data from the right place even when the process /// current working directory differs from the project directory. /// - [DoNotParallelize] [TestClass] public class GivenAGetPackagesToPrune { diff --git a/test/Microsoft.NET.Build.Tasks.Tests/GivenAPickBestRidMultiThreading.cs b/test/Microsoft.NET.Build.Tasks.Tests/GivenAPickBestRidMultiThreading.cs index 229fe50bee87..7f94a2a4c927 100644 --- a/test/Microsoft.NET.Build.Tasks.Tests/GivenAPickBestRidMultiThreading.cs +++ b/test/Microsoft.NET.Build.Tasks.Tests/GivenAPickBestRidMultiThreading.cs @@ -5,7 +5,6 @@ namespace Microsoft.NET.Build.Tasks.UnitTests { - [DoNotParallelize] [TestClass] public class GivenAPickBestRidMultiThreading { diff --git a/test/Microsoft.NET.Build.Tasks.Tests/GivenAResolveAppHostsMultiThreading.cs b/test/Microsoft.NET.Build.Tasks.Tests/GivenAResolveAppHostsMultiThreading.cs index 0076bea3ac6c..72d34ab3fbc3 100644 --- a/test/Microsoft.NET.Build.Tasks.Tests/GivenAResolveAppHostsMultiThreading.cs +++ b/test/Microsoft.NET.Build.Tasks.Tests/GivenAResolveAppHostsMultiThreading.cs @@ -18,7 +18,6 @@ namespace Microsoft.NET.Build.Tasks.UnitTests /// Verifies TaskEnvironment-based path resolution against ProjectDirectory (not process CWD) /// and that output metadata preserves the original path form. /// - [DoNotParallelize] [TestClass] public class GivenAResolveAppHostsMultiThreading : IDisposable { diff --git a/test/Microsoft.NET.Build.Tasks.Tests/GivenAResolvePackageAssetsMultiThreading.cs b/test/Microsoft.NET.Build.Tasks.Tests/GivenAResolvePackageAssetsMultiThreading.cs index 2cf36e6103fb..7ae71b5fdafa 100644 --- a/test/Microsoft.NET.Build.Tasks.Tests/GivenAResolvePackageAssetsMultiThreading.cs +++ b/test/Microsoft.NET.Build.Tasks.Tests/GivenAResolvePackageAssetsMultiThreading.cs @@ -6,7 +6,6 @@ namespace Microsoft.NET.Build.Tasks.UnitTests { - [DoNotParallelize] [TestClass] public class GivenAResolvePackageAssetsMultiThreading { diff --git a/test/Microsoft.NET.Build.Tasks.Tests/GivenAResolvePackageFileConflictsMultiThreading.cs b/test/Microsoft.NET.Build.Tasks.Tests/GivenAResolvePackageFileConflictsMultiThreading.cs index de07de7273f4..e990a636a200 100644 --- a/test/Microsoft.NET.Build.Tasks.Tests/GivenAResolvePackageFileConflictsMultiThreading.cs +++ b/test/Microsoft.NET.Build.Tasks.Tests/GivenAResolvePackageFileConflictsMultiThreading.cs @@ -7,7 +7,6 @@ using Microsoft.NET.Build.Tasks.ConflictResolution; namespace Microsoft.NET.Build.Tasks.UnitTests; -[DoNotParallelize] [TestClass] public class GivenAResolvePackageFileConflictsMultiThreading : IDisposable { diff --git a/test/Microsoft.NET.Build.Tasks.Tests/GivenAResolveRuntimePackAssetsTask.cs b/test/Microsoft.NET.Build.Tasks.Tests/GivenAResolveRuntimePackAssetsTask.cs index b0f4988b2a37..ed4c95b3291e 100644 --- a/test/Microsoft.NET.Build.Tasks.Tests/GivenAResolveRuntimePackAssetsTask.cs +++ b/test/Microsoft.NET.Build.Tasks.Tests/GivenAResolveRuntimePackAssetsTask.cs @@ -7,7 +7,6 @@ namespace Microsoft.NET.Build.Tasks.UnitTests { - [DoNotParallelize] [TestClass] public class GivenAResolveRuntimePackAssetsTask : SdkTest { diff --git a/test/Microsoft.NET.Build.Tasks.Tests/GivenATaskEnvironmentDefault.cs b/test/Microsoft.NET.Build.Tasks.Tests/GivenATaskEnvironmentDefault.cs index 611e24fb6d2e..93fc5defec85 100644 --- a/test/Microsoft.NET.Build.Tasks.Tests/GivenATaskEnvironmentDefault.cs +++ b/test/Microsoft.NET.Build.Tasks.Tests/GivenATaskEnvironmentDefault.cs @@ -19,7 +19,6 @@ namespace Microsoft.NET.Build.Tasks.UnitTests /// . Tasks default to /// which uses live process state, equivalent to the legacy single-threaded behavior. /// - [DoNotParallelize] [TestClass] public class GivenATaskEnvironmentDefault { diff --git a/test/Microsoft.NET.Build.Tasks.Tests/GivenTasksUseAbsolutePaths.cs b/test/Microsoft.NET.Build.Tasks.Tests/GivenTasksUseAbsolutePaths.cs index 06305048f170..4b83fdc3192f 100644 --- a/test/Microsoft.NET.Build.Tasks.Tests/GivenTasksUseAbsolutePaths.cs +++ b/test/Microsoft.NET.Build.Tasks.Tests/GivenTasksUseAbsolutePaths.cs @@ -17,7 +17,6 @@ namespace Microsoft.NET.Build.Tasks.UnitTests; /// These tests create files in a "project" directory, then verify task behavior by /// passing RELATIVE paths and expecting tasks to resolve them via TaskEnvironment. /// -[DoNotParallelize] [TestClass] public class GivenTasksUseAbsolutePaths : IDisposable { diff --git a/test/Microsoft.NET.Sdk.Publish.Tasks.Tests/EnvironmentHelperTests.cs b/test/Microsoft.NET.Sdk.Publish.Tasks.Tests/EnvironmentHelperTests.cs index 0cc6077fefd1..766ae00dc889 100644 --- a/test/Microsoft.NET.Sdk.Publish.Tasks.Tests/EnvironmentHelperTests.cs +++ b/test/Microsoft.NET.Sdk.Publish.Tasks.Tests/EnvironmentHelperTests.cs @@ -6,7 +6,6 @@ namespace Microsoft.NET.Sdk.Publish.Tasks.Tests { [TestClass] - [DoNotParallelize] public class EnvironmentHelperTests { private const string TelemetryOptout = "DOTNET_CLI_TELEMETRY_OPTOUT"; diff --git a/test/Microsoft.NET.Sdk.Razor.Tool.Tests/ServerCommandTest.cs b/test/Microsoft.NET.Sdk.Razor.Tool.Tests/ServerCommandTest.cs index 2bc29c830962..0ee45205b545 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tool.Tests/ServerCommandTest.cs +++ b/test/Microsoft.NET.Sdk.Razor.Tool.Tests/ServerCommandTest.cs @@ -11,10 +11,6 @@ namespace Microsoft.NET.Sdk.Razor.Tool { [TestClass] - // GetPidFilePath_UsesEnvironmentVariablePathIfSpecified mutates the process-wide - // DOTNET_BUILD_PIDFILE_DIRECTORY environment variable that GetPidFilePath_ReturnsCorrectDefaultPath - // reads, so the methods of this class must not run in parallel with each other. - [DoNotParallelize] public class ServerCommandTest { [TestMethod] diff --git a/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/ComputeStaticWebAssetsTargetPathsMultiThreadingTest.cs b/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/ComputeStaticWebAssetsTargetPathsMultiThreadingTest.cs index 52e64da90738..f7756bd5c5c3 100644 --- a/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/ComputeStaticWebAssetsTargetPathsMultiThreadingTest.cs +++ b/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/ComputeStaticWebAssetsTargetPathsMultiThreadingTest.cs @@ -15,7 +15,6 @@ namespace Microsoft.NET.Sdk.StaticWebAssets.Tests; -[DoNotParallelize] [TestClass] public class ComputeStaticWebAssetsTargetPathsMultiThreadingTest { diff --git a/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/CollectStaticWebAssetsToCopyMultiThreadingTest.cs b/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/CollectStaticWebAssetsToCopyMultiThreadingTest.cs index e651b193c59d..4722b17d24ce 100644 --- a/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/CollectStaticWebAssetsToCopyMultiThreadingTest.cs +++ b/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/CollectStaticWebAssetsToCopyMultiThreadingTest.cs @@ -9,9 +9,6 @@ namespace Microsoft.AspNetCore.Razor.Tasks; -// This test mutates the process-wide current directory, so it must not run -// concurrently with other tests under MSTest's method-level parallelization. -[DoNotParallelize] [TestClass] public class CollectStaticWebAssetsToCopyMultiThreadingTest { diff --git a/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/ComputeEndpointsForReferenceStaticWebAssetsMultiThreadingTest.cs b/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/ComputeEndpointsForReferenceStaticWebAssetsMultiThreadingTest.cs index a88ca0dab1c8..a861e7ccbf35 100644 --- a/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/ComputeEndpointsForReferenceStaticWebAssetsMultiThreadingTest.cs +++ b/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/ComputeEndpointsForReferenceStaticWebAssetsMultiThreadingTest.cs @@ -16,7 +16,6 @@ namespace Microsoft.NET.Sdk.StaticWebAssets.Tests; -[DoNotParallelize] [TestClass] public class ComputeEndpointsForReferenceStaticWebAssetsMultiThreadingTest diff --git a/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/DiscoverPrecompressedAssetsMultiThreadingTest.cs b/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/DiscoverPrecompressedAssetsMultiThreadingTest.cs index a1f5fe52ca9a..da788e608290 100644 --- a/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/DiscoverPrecompressedAssetsMultiThreadingTest.cs +++ b/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/DiscoverPrecompressedAssetsMultiThreadingTest.cs @@ -15,7 +15,6 @@ namespace Microsoft.NET.Sdk.StaticWebAssets.Tests; -[DoNotParallelize] [TestClass] public class DiscoverPrecompressedAssetsMultiThreadingTest diff --git a/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/GenerateStaticWebAssetsManifestMultiThreadingTest.cs b/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/GenerateStaticWebAssetsManifestMultiThreadingTest.cs index 9266ab9ebbbf..678407da0f8f 100644 --- a/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/GenerateStaticWebAssetsManifestMultiThreadingTest.cs +++ b/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/GenerateStaticWebAssetsManifestMultiThreadingTest.cs @@ -9,9 +9,6 @@ namespace Microsoft.NET.Sdk.StaticWebAssets.Tests; -// This test mutates the process-wide current directory, so it must not run -// concurrently with other tests under MSTest's method-level parallelization. -[DoNotParallelize] [TestClass] public class GenerateStaticWebAssetsManifestMultiThreadingTest { diff --git a/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/GenerateStaticWebAssetsPropsFileMultiThreadingTest.cs b/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/GenerateStaticWebAssetsPropsFileMultiThreadingTest.cs index 5fd5af8a9659..35e03beb3fe3 100644 --- a/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/GenerateStaticWebAssetsPropsFileMultiThreadingTest.cs +++ b/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/GenerateStaticWebAssetsPropsFileMultiThreadingTest.cs @@ -10,9 +10,6 @@ namespace Microsoft.NET.Sdk.StaticWebAssets.Tests; -// This test mutates the process-wide current directory, so it must not run -// concurrently with other tests under MSTest's method-level parallelization. -[DoNotParallelize] [TestClass] public class GenerateStaticWebAssetsPropsFileMultiThreadingTest { diff --git a/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/MergeConfigurationPropertiesMultiThreadingTest.cs b/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/MergeConfigurationPropertiesMultiThreadingTest.cs index e5b9ef277e71..8f826cd42135 100644 --- a/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/MergeConfigurationPropertiesMultiThreadingTest.cs +++ b/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/MergeConfigurationPropertiesMultiThreadingTest.cs @@ -16,11 +16,6 @@ namespace Microsoft.NET.Sdk.StaticWebAssets.Tests; -// Test parallelization is disabled assembly-wide via -// [assembly:CollectionBehavior(DisableTestParallelization = true)] in -// LegacyStaticWebAssetsV1IntegrationTest.cs, which already isolates the -// process-CWD mutation this test performs. -[DoNotParallelize] [TestClass] public class MergeConfigurationPropertiesMultiThreadingTest { diff --git a/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/ReadStaticWebAssetsManifestFileMultiThreadingTest.cs b/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/ReadStaticWebAssetsManifestFileMultiThreadingTest.cs index d70c21a38790..b4bb116d1213 100644 --- a/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/ReadStaticWebAssetsManifestFileMultiThreadingTest.cs +++ b/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/ReadStaticWebAssetsManifestFileMultiThreadingTest.cs @@ -9,9 +9,6 @@ namespace Microsoft.AspNetCore.Razor.Tasks; -// This test mutates the process-wide current directory, so it must not run -// concurrently with other tests under MSTest's method-level parallelization. -[DoNotParallelize] [TestClass] public class ReadStaticWebAssetsManifestFileMultiThreadingTest { diff --git a/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/StaticWebAssetTaskEnvironmentTests.cs b/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/StaticWebAssetTaskEnvironmentTests.cs index abc774bc4b6c..5e3194765ecb 100644 --- a/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/StaticWebAssetTaskEnvironmentTests.cs +++ b/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/StaticWebAssetTaskEnvironmentTests.cs @@ -15,11 +15,6 @@ namespace Microsoft.NET.Sdk.StaticWebAssets.Tests; -// Test parallelization is disabled assembly-wide via -// [assembly:CollectionBehavior(DisableTestParallelization = true)] in -// LegacyStaticWebAssetsV1IntegrationTest.cs, which already isolates the -// process-CWD mutation these tests perform. -[DoNotParallelize] [TestClass] public class StaticWebAssetTaskEnvironmentTests { diff --git a/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/StaticWebAssetsGeneratePackManifestMultiThreadingTest.cs b/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/StaticWebAssetsGeneratePackManifestMultiThreadingTest.cs index 31eb7856914a..27b21a5eef8a 100644 --- a/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/StaticWebAssetsGeneratePackManifestMultiThreadingTest.cs +++ b/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/StaticWebAssetsGeneratePackManifestMultiThreadingTest.cs @@ -10,9 +10,6 @@ namespace Microsoft.AspNetCore.Razor.Tasks; -// This test mutates the process-wide current directory, so it must not run -// concurrently with other tests under MSTest's method-level parallelization. -[DoNotParallelize] [TestClass] public class StaticWebAssetsGeneratePackManifestMultiThreadingTest { diff --git a/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/StaticWebAssetsGeneratePackagePropsFileMultiThreadingTest.cs b/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/StaticWebAssetsGeneratePackagePropsFileMultiThreadingTest.cs index defb8456f423..9dbb16d4664c 100644 --- a/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/StaticWebAssetsGeneratePackagePropsFileMultiThreadingTest.cs +++ b/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/StaticWebAssetsGeneratePackagePropsFileMultiThreadingTest.cs @@ -15,11 +15,6 @@ namespace Microsoft.AspNetCore.Razor.Tasks; -// Test parallelization is disabled assembly-wide via -// [assembly:CollectionBehavior(DisableTestParallelization = true)] in -// LegacyStaticWebAssetsV1IntegrationTest.cs, which already isolates the -// process-CWD mutation this test performs. -[DoNotParallelize] [TestClass] public class StaticWebAssetsGeneratePackagePropsFileMultiThreadingTest { diff --git a/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/UpdatePackageStaticWebAssetsMultiThreadingTest.cs b/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/UpdatePackageStaticWebAssetsMultiThreadingTest.cs index 12d0a5edddfd..2947d813cac4 100644 --- a/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/UpdatePackageStaticWebAssetsMultiThreadingTest.cs +++ b/test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/UpdatePackageStaticWebAssetsMultiThreadingTest.cs @@ -10,9 +10,6 @@ namespace Microsoft.NET.Sdk.StaticWebAssets.Tests; -// This test mutates the process-wide current directory, so it must not run -// concurrently with other tests under MSTest's method-level parallelization. -[DoNotParallelize] [TestClass] public class UpdatePackageStaticWebAssetsMultiThreadingTest { diff --git a/test/Microsoft.NET.ToolPack.Tests/GivenThatWeWantToPackAToolProject.cs b/test/Microsoft.NET.ToolPack.Tests/GivenThatWeWantToPackAToolProject.cs index cd0d50cb14cd..bdaf5714bdec 100644 --- a/test/Microsoft.NET.ToolPack.Tests/GivenThatWeWantToPackAToolProject.cs +++ b/test/Microsoft.NET.ToolPack.Tests/GivenThatWeWantToPackAToolProject.cs @@ -19,8 +19,8 @@ public class GivenThatWeWantToPackAToolProject : SdkTest private string SetupNuGetPackage(bool multiTarget, string packageType = null, [CallerMemberName] string callingMethod = "") { // Include all distinguishing parameters so each [DataRow] gets a unique test asset - // directory. Tests run with method-level parallelization (MSTest.Sdk default), so rows - // sharing a directory would race on the copied project files. Sanitize characters that + // directory. Tests run in parallel, so rows sharing a directory would race on the + // copied project files. Sanitize characters that // are unsafe for the directory name and the /bl: binlog argument below. string id = $"{callingMethod}-{multiTarget}-{packageType}-{_targetFrameworkOrFrameworks}" .Replace(' ', '_').Replace(',', '_').Replace(';', '_'); diff --git a/test/Microsoft.NET.ToolPack.Tests/GivenThatWeWantToPackAToolProjectWithPackagedShim.cs b/test/Microsoft.NET.ToolPack.Tests/GivenThatWeWantToPackAToolProjectWithPackagedShim.cs index c46399b27870..860b68d12fd4 100644 --- a/test/Microsoft.NET.ToolPack.Tests/GivenThatWeWantToPackAToolProjectWithPackagedShim.cs +++ b/test/Microsoft.NET.ToolPack.Tests/GivenThatWeWantToPackAToolProjectWithPackagedShim.cs @@ -10,7 +10,6 @@ namespace Microsoft.NET.ToolPack.Tests { [TestClass] - [DoNotParallelize] public class GivenThatWeWantToPackAToolProjectWithPackagedShim : SdkTest { private string _testRoot; diff --git a/test/Microsoft.TemplateEngine.Cli.UnitTests/PostActionTests/AddJsonPropertyPostActionTests.cs b/test/Microsoft.TemplateEngine.Cli.UnitTests/PostActionTests/AddJsonPropertyPostActionTests.cs index 798935d3a08b..d289b3b8facd 100644 --- a/test/Microsoft.TemplateEngine.Cli.UnitTests/PostActionTests/AddJsonPropertyPostActionTests.cs +++ b/test/Microsoft.TemplateEngine.Cli.UnitTests/PostActionTests/AddJsonPropertyPostActionTests.cs @@ -14,10 +14,6 @@ namespace Microsoft.TemplateEngine.Cli.UnitTests.PostActionTests { [TestClass] - // These tests mutate the process-global static Microsoft.DotNet.Cli.Utils.Reporter via - // Reporter.SetError, so they cannot run in parallel with each other (MSTest defaults to - // method-level parallelism in this repo). - [DoNotParallelize] public class AddJsonPropertyPostActionTests { // MSTest has no IClassFixture equivalent; a lazily-initialized static helper diff --git a/test/dotnet-MsiInstallation.Tests/Framework/VMTestBase.cs b/test/dotnet-MsiInstallation.Tests/Framework/VMTestBase.cs index 50b5f98e97e1..578e2720dcf1 100644 --- a/test/dotnet-MsiInstallation.Tests/Framework/VMTestBase.cs +++ b/test/dotnet-MsiInstallation.Tests/Framework/VMTestBase.cs @@ -9,7 +9,6 @@ namespace Microsoft.DotNet.MsiInstallerTests.Framework { - [DoNotParallelize] public class VMTestBase : SdkTest, IDisposable { private VirtualMachine _vm; diff --git a/test/dotnet-aot.Tests/AssemblyInfo.cs b/test/dotnet-aot.Tests/AssemblyInfo.cs deleted file mode 100644 index 56f30480979f..000000000000 --- a/test/dotnet-aot.Tests/AssemblyInfo.cs +++ /dev/null @@ -1,7 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// Tests in this assembly modify process-global state (environment variables, -// Reporter.Output, Console.Out/Error, AppContext data), so they must not -// run in parallel. -[assembly: DoNotParallelize] diff --git a/test/dotnet-format.UnitTests/AssemblyInfo.cs b/test/dotnet-format.UnitTests/AssemblyInfo.cs deleted file mode 100644 index 4323e75ac0c4..000000000000 --- a/test/dotnet-format.UnitTests/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Microsoft.VisualStudio.TestTools.UnitTesting; - -[assembly: DoNotParallelize] diff --git a/test/dotnet.Tests/CommandTests/MSBuild/DotnetMsbuildInProcTests.cs b/test/dotnet.Tests/CommandTests/MSBuild/DotnetMsbuildInProcTests.cs index b195312e0cfb..4c0f93118543 100644 --- a/test/dotnet.Tests/CommandTests/MSBuild/DotnetMsbuildInProcTests.cs +++ b/test/dotnet.Tests/CommandTests/MSBuild/DotnetMsbuildInProcTests.cs @@ -10,7 +10,6 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests { - [DoNotParallelize] [TestClass] public class DotnetMsbuildInProcTests : SdkTest { diff --git a/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetBuildInvocation.cs b/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetBuildInvocation.cs index 8fc605955178..20fd4ce2b7df 100644 --- a/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetBuildInvocation.cs +++ b/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetBuildInvocation.cs @@ -8,7 +8,6 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests { - [DoNotParallelize] [TestClass] public class GivenDotnetBuildInvocation : SdkTest { diff --git a/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetCleanInvocation.cs b/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetCleanInvocation.cs index abd04be06b58..f352fbcfa5e4 100644 --- a/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetCleanInvocation.cs +++ b/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetCleanInvocation.cs @@ -5,7 +5,6 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests { - [DoNotParallelize] [TestClass] public class GivenDotnetCleanInvocation : SdkTest { diff --git a/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetMSBuildBuildsProjects.cs b/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetMSBuildBuildsProjects.cs index b77586e60b53..bd95ba0d573c 100644 --- a/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetMSBuildBuildsProjects.cs +++ b/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetMSBuildBuildsProjects.cs @@ -1,9 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -// There are tests which modify static TelemetryClient.CurrentSessionId. They cannot run in parallel. -[assembly: DoNotParallelize] - namespace Microsoft.DotNet.Cli.MSBuild.Tests { [TestClass] diff --git a/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetMSBuildInvocation.cs b/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetMSBuildInvocation.cs index bfbcac462d8b..c4ad29398b03 100644 --- a/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetMSBuildInvocation.cs +++ b/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetMSBuildInvocation.cs @@ -5,7 +5,6 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests { - [DoNotParallelize] [TestClass] public class GivenDotnetMSBuildInvocation : SdkTest { diff --git a/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetPackInvocation.cs b/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetPackInvocation.cs index d559a4f313a1..fd8994ae3196 100644 --- a/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetPackInvocation.cs +++ b/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetPackInvocation.cs @@ -5,7 +5,6 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests { - [DoNotParallelize] [TestClass] public class GivenDotnetPackInvocation : SdkTest { diff --git a/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetPublishInvocation.cs b/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetPublishInvocation.cs index 30c050ce657d..e9cdad78b266 100644 --- a/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetPublishInvocation.cs +++ b/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetPublishInvocation.cs @@ -5,7 +5,6 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests { - [DoNotParallelize] [TestClass] public class GivenDotnetPublishInvocation : SdkTest { diff --git a/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetRestoreInvocation.cs b/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetRestoreInvocation.cs index 1a4d28567fa4..1dadadddcb06 100644 --- a/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetRestoreInvocation.cs +++ b/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetRestoreInvocation.cs @@ -7,7 +7,6 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests { - [DoNotParallelize] [TestClass] public class GivenDotnetRestoreInvocation : SdkTest { diff --git a/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetRunInvocation.cs b/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetRunInvocation.cs index 65a85ca7ad20..0a7435248353 100644 --- a/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetRunInvocation.cs +++ b/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetRunInvocation.cs @@ -6,7 +6,6 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests { - [DoNotParallelize] [TestClass] public class GivenDotnetRunInvocation : SdkTest { diff --git a/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetStoreInvocation.cs b/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetStoreInvocation.cs index 278f6d81be28..809b34652a19 100644 --- a/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetStoreInvocation.cs +++ b/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetStoreInvocation.cs @@ -5,7 +5,6 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests { - [DoNotParallelize] [TestClass] public class GivenDotnetStoreInvocation : SdkTest { diff --git a/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetTestInvocation.cs b/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetTestInvocation.cs index 2d5a49dc5096..be8baf36609a 100644 --- a/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetTestInvocation.cs +++ b/test/dotnet.Tests/CommandTests/MSBuild/GivenDotnetTestInvocation.cs @@ -6,7 +6,6 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests { - [DoNotParallelize] [TestClass] public class GivenDotnetTestInvocation : SdkTest { diff --git a/test/dotnet.Tests/CommandTests/Workload/List/GivenAnMsiInstallation.cs b/test/dotnet.Tests/CommandTests/Workload/List/GivenAnMsiInstallation.cs index 4e3d64c59e3b..501badca912e 100644 --- a/test/dotnet.Tests/CommandTests/Workload/List/GivenAnMsiInstallation.cs +++ b/test/dotnet.Tests/CommandTests/Workload/List/GivenAnMsiInstallation.cs @@ -11,7 +11,6 @@ namespace Microsoft.DotNet.Cli.Workload.List.Tests { - [DoNotParallelize] [SupportedOSPlatform("windows")] [TestClass] public class GivenAnMsiInstallation : IDisposable diff --git a/test/dotnet.Tests/ConfigurerTests/GivenADotnetFirstTimeUseConfigurerWIthStateSetup.cs b/test/dotnet.Tests/ConfigurerTests/GivenADotnetFirstTimeUseConfigurerWIthStateSetup.cs index 8cd6f793bc59..8ef29774f676 100644 --- a/test/dotnet.Tests/ConfigurerTests/GivenADotnetFirstTimeUseConfigurerWIthStateSetup.cs +++ b/test/dotnet.Tests/ConfigurerTests/GivenADotnetFirstTimeUseConfigurerWIthStateSetup.cs @@ -10,7 +10,6 @@ namespace Microsoft.DotNet.Configurer.UnitTests { - [DoNotParallelize] [TestClass] public class GivenADotnetFirstTimeUseConfigurerWithStateSetup { diff --git a/test/dotnet.Tests/TelemetryTests/TelemetryCommandTest.cs b/test/dotnet.Tests/TelemetryTests/TelemetryCommandTest.cs index 0b28164acdb5..94d367939237 100644 --- a/test/dotnet.Tests/TelemetryTests/TelemetryCommandTest.cs +++ b/test/dotnet.Tests/TelemetryTests/TelemetryCommandTest.cs @@ -8,7 +8,6 @@ namespace Microsoft.DotNet.Tests.TelemetryTests; -[DoNotParallelize] [TestClass] public class TelemetryCommandTests : SdkTest { From ba1f637a6289223010654eea8da645b1cb3a3b09 Mon Sep 17 00:00:00 2001 From: Amaury Leveugle Date: Thu, 25 Jun 2026 07:58:27 +0200 Subject: [PATCH 2/4] Repurpose to cleanup: remove remaining redundant [DoNotParallelize] attributes Following #54943 which disabled in-process parallel test execution (MSTestParallelizeScope=None), the remaining [DoNotParallelize] guards are no-ops. Remove them and revert the leftover ClassLevel-era comment edit so the change is a pure attribute cleanup. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../GivenThatWeWantToPackAToolProject.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.NET.ToolPack.Tests/GivenThatWeWantToPackAToolProject.cs b/test/Microsoft.NET.ToolPack.Tests/GivenThatWeWantToPackAToolProject.cs index bdaf5714bdec..cd0d50cb14cd 100644 --- a/test/Microsoft.NET.ToolPack.Tests/GivenThatWeWantToPackAToolProject.cs +++ b/test/Microsoft.NET.ToolPack.Tests/GivenThatWeWantToPackAToolProject.cs @@ -19,8 +19,8 @@ public class GivenThatWeWantToPackAToolProject : SdkTest private string SetupNuGetPackage(bool multiTarget, string packageType = null, [CallerMemberName] string callingMethod = "") { // Include all distinguishing parameters so each [DataRow] gets a unique test asset - // directory. Tests run in parallel, so rows sharing a directory would race on the - // copied project files. Sanitize characters that + // directory. Tests run with method-level parallelization (MSTest.Sdk default), so rows + // sharing a directory would race on the copied project files. Sanitize characters that // are unsafe for the directory name and the /bl: binlog argument below. string id = $"{callingMethod}-{multiTarget}-{packageType}-{_targetFrameworkOrFrameworks}" .Replace(' ', '_').Replace(',', '_').Replace(';', '_'); From 718f253267b540f90c3b61fea8f935096c46ab61 Mon Sep 17 00:00:00 2001 From: Amaury Leveugle Date: Thu, 25 Jun 2026 13:16:43 +0200 Subject: [PATCH 3/4] Fix MSTEST0001: set None scope on projects that relied on manual assembly attribute Five projects (EndToEnd.Tests, dotnet-aot.Tests, dotnet-format.UnitTests, dotnet.Tests, Microsoft.DotNet.MSBuildSdkResolver.Tests) set an empty MSTestParallelizeScope, which suppresses MSTest.Sdk emission, and supplied their own [assembly: DoNotParallelize]. Those manual attributes were removed as part of this cleanup, leaving the assemblies with no parallelization declaration, which trips the MSTEST0001 analyzer (promoted to error via MSTestAnalysisMode=Recommended). Set MSTestParallelizeScope=None on those projects so MSTest.Sdk emits [assembly: DoNotParallelize] automatically, preserving serial execution while satisfying the analyzer. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- test/EndToEnd.Tests/EndToEnd.Tests.csproj | 4 ++-- .../Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj | 6 +++--- test/dotnet-aot.Tests/dotnet-aot.Tests.csproj | 4 ++-- test/dotnet-format.UnitTests/dotnet-format.UnitTests.csproj | 3 ++- test/dotnet.Tests/dotnet.Tests.csproj | 3 ++- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/test/EndToEnd.Tests/EndToEnd.Tests.csproj b/test/EndToEnd.Tests/EndToEnd.Tests.csproj index 92827e0c5cfe..9af9b7bc5537 100644 --- a/test/EndToEnd.Tests/EndToEnd.Tests.csproj +++ b/test/EndToEnd.Tests/EndToEnd.Tests.csproj @@ -5,8 +5,8 @@ $(SdkTargetFramework) - - + + None diff --git a/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj b/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj index 4a4f43de25d0..b014a7815c3c 100644 --- a/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj +++ b/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj @@ -7,9 +7,9 @@ net472 - - + + None diff --git a/test/dotnet-aot.Tests/dotnet-aot.Tests.csproj b/test/dotnet-aot.Tests/dotnet-aot.Tests.csproj index e1e8037dc507..a0c86572ec90 100644 --- a/test/dotnet-aot.Tests/dotnet-aot.Tests.csproj +++ b/test/dotnet-aot.Tests/dotnet-aot.Tests.csproj @@ -6,8 +6,8 @@ $(DefineConstants);CLI_AOT Microsoft.DotNet.Cli.Tests MicrosoftAspNetCore - - + + None $(NoWarn);CS8002 diff --git a/test/dotnet-format.UnitTests/dotnet-format.UnitTests.csproj b/test/dotnet-format.UnitTests/dotnet-format.UnitTests.csproj index 743fb92e7a46..3410cab488ac 100644 --- a/test/dotnet-format.UnitTests/dotnet-format.UnitTests.csproj +++ b/test/dotnet-format.UnitTests/dotnet-format.UnitTests.csproj @@ -8,7 +8,8 @@ LatestMajor true $(DefaultExcludesInProjectFolder);binaries\**;projects\** - + + None diff --git a/test/dotnet.Tests/dotnet.Tests.csproj b/test/dotnet.Tests/dotnet.Tests.csproj index f464b48abe41..056d60a43886 100644 --- a/test/dotnet.Tests/dotnet.Tests.csproj +++ b/test/dotnet.Tests/dotnet.Tests.csproj @@ -11,7 +11,8 @@ $(TestHostFolder) false true - + + None From a7e23e7e6364c56b23f254c1b8e66b7ff72202a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Thu, 25 Jun 2026 15:18:27 +0200 Subject: [PATCH 4/4] Apply suggestion from @Evangelink --- .../Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj b/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj index b014a7815c3c..a250252e4225 100644 --- a/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj +++ b/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj @@ -7,9 +7,6 @@ net472 - - None