From f9a722a87ee9d28c893faf18799ae6beb2aaac84 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Sun, 1 Sep 2024 03:28:30 +0200 Subject: [PATCH] Test parallelization stuff. (#31650) This is the content analogue of https://github.com/space-wizards/RobustToolbox/pull/5412 Made Content.Tests run tests parallelized, which doesn't really seem to matter much. I tried to make Content.IntegrationTest more aggressively parallelized but ran into https://github.com/dotnet/runtime/issues/107197 so we need to shelve that. Added a comment explaining as such. --- Content.IntegrationTests/AssemblyInfo.cs | 8 ++++++++ Content.IntegrationTests/PoolManager.cs | 2 -- Content.IntegrationTests/PoolManagerTestEventHandler.cs | 5 +---- Content.Tests/AssemblyInfo.cs | 3 +++ 4 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 Content.IntegrationTests/AssemblyInfo.cs create mode 100644 Content.Tests/AssemblyInfo.cs diff --git a/Content.IntegrationTests/AssemblyInfo.cs b/Content.IntegrationTests/AssemblyInfo.cs new file mode 100644 index 00000000000..76fc42f3a91 --- /dev/null +++ b/Content.IntegrationTests/AssemblyInfo.cs @@ -0,0 +1,8 @@ +[assembly: Parallelizable(ParallelScope.Children)] + +// I don't know why this parallelism limit was originally put here. +// I *do* know that I tried removing it, and ran into the following .NET runtime problem: +// https://github.com/dotnet/runtime/issues/107197 +// So we can't really parallelize integration tests harder either until the runtime fixes that, +// *or* we fix serv3 to not spam expression trees. +[assembly: LevelOfParallelism(3)] diff --git a/Content.IntegrationTests/PoolManager.cs b/Content.IntegrationTests/PoolManager.cs index 34ac4060ddc..c7b8dcaee96 100644 --- a/Content.IntegrationTests/PoolManager.cs +++ b/Content.IntegrationTests/PoolManager.cs @@ -23,8 +23,6 @@ using Robust.Shared.Timing; using Robust.UnitTesting; -[assembly: LevelOfParallelism(3)] - namespace Content.IntegrationTests; /// diff --git a/Content.IntegrationTests/PoolManagerTestEventHandler.cs b/Content.IntegrationTests/PoolManagerTestEventHandler.cs index 3b26d6637fd..be4c746a60a 100644 --- a/Content.IntegrationTests/PoolManagerTestEventHandler.cs +++ b/Content.IntegrationTests/PoolManagerTestEventHandler.cs @@ -1,7 +1,4 @@ - -[assembly: Parallelizable(ParallelScope.Children)] - -namespace Content.IntegrationTests; +namespace Content.IntegrationTests; [SetUpFixture] public sealed class PoolManagerTestEventHandler diff --git a/Content.Tests/AssemblyInfo.cs b/Content.Tests/AssemblyInfo.cs new file mode 100644 index 00000000000..8e01f41b183 --- /dev/null +++ b/Content.Tests/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using NUnit.Framework; + +[assembly: Parallelizable(ParallelScope.Fixtures)]