Skip to content

A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.

Tests: run AFullTurnOfMovesIsFast in a non-parallel Perf collection (Fixes #1303) (#1311)

Beri69ebed130fe2
diff --git a/changelog.d/1303.md b/changelog.d/1303.md
new file mode 100644
index 000000000..b43687758
--- /dev/null
+++ b/changelog.d/1303.md
@@ -0,0 +1,2 @@
+- `MovementTests.AFullTurnOfMovesIsFast` now runs in its own non-parallel `Perf` xUnit collection, so its 16 ms wall-clock budget
+ no longer competes with the parallel test classes for the CPU (Fixes #1303). The budget is unchanged.
diff --git a/sim/Statecraft.Sim.Tests/MovementTests.cs b/sim/Statecraft.Sim.Tests/MovementTests.cs
index f8530a7c2..f9fa0343e 100644
--- a/sim/Statecraft.Sim.Tests/MovementTests.cs
+++ b/sim/Statecraft.Sim.Tests/MovementTests.cs
@@ -360,6 +360,18 @@ public class MovementTests
Assert.Equal((file, field), (ex.File, ex.Field));
Assert.Contains(message, ex.Message);
}
+}
+
+// The 16 ms budget is a wall-clock one, so the test must not share the CPU with the parallel test classes (main's CI saw
+// 21.94 ms on a 4-vCPU runner against about 2.7 ms alone, #1303): a DisableParallelization collection runs after them, alone.
+[CollectionDefinition("Perf", DisableParallelization = true)]
+public class PerfCollection { }
+
+[Collection("Perf")]
+public class MovementPerfTests
+{
+ readonly ITestOutputHelper _out;
+ public MovementPerfTests(ITestOutputHelper output) { _out = output; }
// Performance (spec §2.5): a Reachable for a fast unit on each of the real game's 25 settlement hexes, on the 870-hex
// board, stays under one Step's 16 ms WebGL budget. Measured on .NET, best of five runs; the margin is printed.