acdream/tests/AcDream.Content.Tests
Erik dc0468cc2b fix(tests): replace sleep-race concurrency proofs in RetailDatLoaderTests
Two tests proved "these two unrelated DAT reads ran concurrently" by
racing a fixed Thread.Sleep(40) window against .NET thread-pool
scheduling latency for a second Task.Run. Under the CPU contention of
a full `dotnet test AcDream.slnx` run (all 9 test projects' VSTest
hosts launch concurrently) plus a busy machine, thread-pool injection
can occasionally miss the window, making MaxConcurrentReads read 1
instead of 2 and failing the assertion with no underlying code defect.

RetailAnimationLoader and RetailPhysicsScriptLoader both coalesce
same-key reads correctly via ConcurrentDictionary<K, Lazy<T>>.GetOrAdd,
which is atomic and timing-independent (verified by reading, not just
running) - only the test's method of proving cross-key overlap was
timing-fragile. DecodedTextureCacheTests already uses the correct
deterministic-gate pattern; this brings RetailDatLoaderTests in line
with it via a Barrier-backed rendezvous instead of a sleep race.

Filed as #248 (docs/ISSUES.md) with the full attempt matrix: could not
catch the originally-reported AcDream.Content.Tests failure in the act
despite ~72 Content.Tests executions across four contention strategies
over ~30 full-suite-equivalent runs, though the general mechanism
reproduced 3x in AcDream.App.Tests's already-known zero-allocation
flake class (left untouched, out of scope here).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-30 11:03:03 +02:00
..
Spells feat(headless): share immutable gameplay content 2026-07-27 09:00:48 +02:00
Vfx fix(tests): replace sleep-race concurrency proofs in RetailDatLoaderTests 2026-07-30 11:03:03 +02:00
AcDream.Content.Tests.csproj test(pipeline): MP1b - live-vs-pak equivalence suite (dat-gated) 2026-07-05 21:33:32 +02:00
BoundedDatObjectCacheTests.cs perf(diag): per-frame history export + checkpoint LOH/cache counters + soak capped mode (2026-07-24 audit review) 2026-07-24 12:00:30 +02:00
ContentConformanceDats.cs test(pipeline): MP1b - live-vs-pak equivalence suite (dat-gated) 2026-07-05 21:33:32 +02:00
Crc32Tests.cs fix(pipeline): MP1b review - pak format/reader hardening 2026-07-05 22:08:59 +02:00
DatResolutionPrecedenceTests.cs perf(content): remove exception-driven setup probes 2026-07-24 15:12:21 +02:00
DecodedTextureCacheTests.cs perf(diag): per-frame history export + checkpoint LOH/cache counters + soak capped mode (2026-07-24 audit review) 2026-07-24 12:00:30 +02:00
FlatCollisionAssetSerializerTests.cs feat(content): bake and read flat collision assets 2026-07-25 15:22:08 +02:00
InstalledPreparedCollisionCatalogTests.cs feat(content): bake and read flat collision assets 2026-07-25 15:22:08 +02:00
ObjectMeshDataEquality.cs perf(render): consume prepared mesh package at runtime 2026-07-24 15:07:25 +02:00
ObjectMeshDataSerializerTests.cs perf(render): consume prepared mesh package at runtime 2026-07-24 15:07:25 +02:00
PakAliasTests.cs feat(content): add physical blob aliases to pak writer 2026-07-24 13:33:53 +02:00
PakEquivalenceTests.cs feat(bake): publish validated pak artifacts atomically 2026-07-24 13:40:58 +02:00
PakFormatTests.cs feat(pipeline): MP1b - pak key + header/TOC primitives 2026-07-05 21:14:10 +02:00
PakKeyTests.cs feat(content): bake and read flat collision assets 2026-07-25 15:22:08 +02:00
PakRoundTripTests.cs feat(bake): publish validated pak artifacts atomically 2026-07-24 13:40:58 +02:00
PreparedAssetSourceTests.cs perf(content): add typed prepared asset source 2026-07-24 14:52:12 +02:00
SharedPreparedCollisionCacheTests.cs feat(headless): share immutable gameplay content 2026-07-27 09:00:48 +02:00
SolidColorTextureCacheTests.cs perf(content): CellStruct clone guard, solid-color texture cache, drop double ToList (2026-07-24 audit review) 2026-07-24 11:49:46 +02:00