From 2fd99c4265801932adba717a546b5d0d9725cd29 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 13 Aug 2026 08:52:12 +0200 Subject: [PATCH] test: FarLoad strip test asserts each build config's designed outcome MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LandblockStreamer.HandleJob's near-payload check is "fail loud in Debug builds and strip in Release" (its own comment, with a Debug.Assert at the check). FarLoad_StripsEnvCellsAndPhysicsEvenWhenEntityListIsAlreadyEmpty feeds a deliberately-buggy far factory to verify the Release strip — so under Debug the assert fires, the test host's listener turns it into an exception, and the job publishes Failed BY DESIGN. The test asserted the Release outcome unconditionally and therefore failed on every full Debug App run (found 2026-08-13 during the #385 session; every campaign gate runs Release, which is why it never surfaced). It now asserts the Failed result + assert message under DEBUG and the strip under Release. Verified green in both configs; full Debug App suite 4,937/3 skips. Co-Authored-By: Claude Fable 5 --- .../Streaming/LandblockBuildOriginTests.cs | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/tests/AcDream.App.Tests/Streaming/LandblockBuildOriginTests.cs b/tests/AcDream.App.Tests/Streaming/LandblockBuildOriginTests.cs index 1de0a773..9abb646a 100644 --- a/tests/AcDream.App.Tests/Streaming/LandblockBuildOriginTests.cs +++ b/tests/AcDream.App.Tests/Streaming/LandblockBuildOriginTests.cs @@ -221,14 +221,30 @@ public sealed class LandblockBuildOriginTests origin)); streamer.Start(); - var loaded = Assert.IsType( - await DrainFirstAsync(streamer)); + LandblockStreamResult result = await DrainFirstAsync(streamer); + +#if DEBUG + // LandblockStreamer.HandleJob's near-payload check is "fail loud in + // Debug builds and strip in Release" (its own comment): the + // Debug.Assert fires on this deliberately-buggy factory, the test + // host's trace listener turns it into an exception, and the job's + // catch-all publishes it as Failed. That IS the designed Debug + // outcome — this test previously asserted the Release strip + // unconditionally and so failed on every full Debug run + // (found 2026-08-13; the campaign gates all run Release). + var failed = Assert.IsType(result); + Assert.Equal(landblockId, failed.LandblockId); + Assert.Equal(84ul, failed.Generation); + Assert.Contains("Far-tier factory returned Near payload", failed.Error); +#else + var loaded = Assert.IsType(result); Assert.Equal(LandblockStreamTier.Far, loaded.Tier); Assert.Empty(loaded.Landblock.Entities); Assert.Same(PhysicsDatBundle.Empty, loaded.Landblock.PhysicsDats); Assert.Null(loaded.Build.EnvCells); Assert.Equal(origin, loaded.Build.Origin); +#endif } [Fact]