From 60b87432491c610dfd2ebe3ecc0ad9d73ea7722b Mon Sep 17 00:00:00 2001 From: Rhys Parry Date: Thu, 7 May 2026 03:39:31 +0000 Subject: [PATCH] Reduce CI test parallelism cap from 8 to 4 Lower contention on CI agents to reduce timing-coupled and connection race flakiness. The test suite spawns out-of-process compatibility binaries and many short-lived loopback TCP connections; at 6+ in-flight tests on an 8 vCPU agent this regularly produces ephemeral-port and TcpClientManager dispose races that show up as "connection forcibly closed" failures, plus Stopwatch-vs-wall-clock drift on Windows 2012R2 guests under load. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../CustomLevelOfParallelismAttribute.cs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/source/Halibut.Tests/Support/TestAttributes/CustomLevelOfParallelismAttribute.cs b/source/Halibut.Tests/Support/TestAttributes/CustomLevelOfParallelismAttribute.cs index aea37f95d..50857221a 100644 --- a/source/Halibut.Tests/Support/TestAttributes/CustomLevelOfParallelismAttribute.cs +++ b/source/Halibut.Tests/Support/TestAttributes/CustomLevelOfParallelismAttribute.cs @@ -39,21 +39,16 @@ public static int LevelOfParallelism() /// 4 CPU = 2 Parallel Tests /// 5 CPU = 3 Parallel Tests /// 6 CPU = 4 Parallel Tests - /// 7 CPU = 5 Parallel Tests - /// 8 CPU = 6 Parallel Tests - /// 9 CPU = 7 Parallel Tests - /// 10 CPU = 8 Parallel Tests - /// 11 CPU = 8 Parallel Tests - /// 12 CPU = 8 Parallel Tests - /// 13 CPU = 8 Parallel Tests - /// 14 CPU = 8 Parallel Tests + /// 7 CPU = 4 Parallel Tests + /// 8 CPU = 4 Parallel Tests + /// 9+ CPU = 4 Parallel Tests /// static int LevelOfParallelismInTeamCity() { - var max = 8; + var max = 4; var min = 2; var defaultBasedOnCpu = NUnitTestAssemblyRunner.DefaultLevelOfParallelism; - + return Math.Min(Math.Max(min, defaultBasedOnCpu - 2), max); }