test: FarLoad strip test asserts each build config's designed outcome

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 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-08-13 08:52:12 +02:00
parent a9b6435f55
commit 2fd99c4265

View file

@ -221,14 +221,30 @@ public sealed class LandblockBuildOriginTests
origin));
streamer.Start();
var loaded = Assert.IsType<LandblockStreamResult.Loaded>(
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<LandblockStreamResult.Failed>(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<LandblockStreamResult.Loaded>(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]