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.
This commit is contained in:
Erik 2026-07-24 21:26:53 +02:00
parent b2b67341ac
commit dbaea19269

View file

@ -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<StreamingMutationException>(() => controller.Tick(0xB0, 0xB0));
Assert.Equal(1, failedCalls);
@ -1367,6 +1369,15 @@ public sealed class LandblockPresentationPipelineTests
Array.Empty<TerrainVertex>(),
Array.Empty<uint>());
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<LandblockStreamResult> Drain(
Queue<LandblockStreamResult> queue,
int max)