From dbaea19269a48b90919a679a4275ff63736c7477 Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 24 Jul 2026 21:26:53 +0200 Subject: [PATCH] test(streaming): decouple lifecycle assertions from wall time Use an explicit generous work profile in multi-operation behavior tests. Their contract is failure isolation and retirement ordering, not whether cold JIT work fits the production two-millisecond frame budget. --- .../LandblockPresentationPipelineTests.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/AcDream.App.Tests/Streaming/LandblockPresentationPipelineTests.cs b/tests/AcDream.App.Tests/Streaming/LandblockPresentationPipelineTests.cs index 60eace48..f5671012 100644 --- a/tests/AcDream.App.Tests/Streaming/LandblockPresentationPipelineTests.cs +++ b/tests/AcDream.App.Tests/Streaming/LandblockPresentationPipelineTests.cs @@ -133,7 +133,8 @@ public sealed class LandblockPresentationPipelineTests neighborAttempts++; if (failNeighbor) throw new InvalidOperationException("injected non-center failure"); - }); + }, + workBudgetOptions: GenerousWorkBudget()); var recenter = new StreamingOriginRecenterCoordinator(controller, origin); Assert.False(recenter.Begin(0x22, 0x23, isSealedDungeon: false)); @@ -1223,7 +1224,8 @@ public sealed class LandblockPresentationPipelineTests }, state, nearRadius: 0, - farRadius: 2); + farRadius: 2, + workBudgetOptions: GenerousWorkBudget()); Assert.Throws(() => controller.Tick(0xB0, 0xB0)); Assert.Equal(1, failedCalls); @@ -1367,6 +1369,15 @@ public sealed class LandblockPresentationPipelineTests Array.Empty(), Array.Empty()); + private static StreamingWorkBudgetOptions GenerousWorkBudget() => new( + MaxUpdateMilliseconds: 1_000, + MaxCompletionAdmissions: 1_000, + MaxAdoptedCpuBytes: 1L << 40, + MaxEntityOperations: 1_000_000, + MaxGpuUploadBytes: 1L << 40, + MaxGlRetireOperations: 1_000_000, + DestinationReserveFraction: 0.75f); + private static IReadOnlyList Drain( Queue queue, int max)