ModernUO/Projects/UOContent.Tests/Tests
Kamron Batman 225c634bf7
test: stop the 1 ms promotion window leaking out of StepCacheLifecycleTests (#2679)
## Summary

`Find_TwoPathfindsOverlappingChunks_PromoteToBuildOnSecondFind` fails intermittently in CI with `second Find through overlapping chunks must promote (got 0 builds)`.

**Cause:** `SecondTouchAfterWindow_RestartsTheCount` and `TwoFindsAcrossTheWindow_DoNotPromote` set `StepCache.Instance.MissPromotionWindowMs = 1` and never restore it, and `Clear()` does not reset it. Both classes share the `Sequential Pathfinding Tests` collection, so when a lifecycle test runs first, the promotion test's two Finds have to land within 1 ms of each other. On Linux, `Environment.TickCount` moves in coarse steps of several ms, so even a sub-millisecond test can see the window lapse. The second Find then restarts the miss count instead of promoting. On Windows the ~15.6 ms tick nearly always reads the same value for both Finds, which is why it didn't reproduce locally.

**Fix (tests only):**
- `StepCacheLifecycleTests` implements `IDisposable` and restores the window after each test.
- The promotion test sets the window it depends on (30 s) instead of inheriting it.

## Test plan

- [x] Reproduced deterministically: with a temporary 20 ms sleep between the two Finds, the test fails whenever the lifecycle tests run first and passes when run alone
- [x] With the sleep still in, the test passes with the Dispose restore alone and with both fixes
- [x] All pathfinding tests pass (123/123) with the sleep removed
2026-09-25 00:55:07 -07:00
..
Accounting perf(login): run password hashing on a parked worker thread (#2566) 2026-08-09 00:13:34 -07:00
Commands fix: TextDefinition was uneditable in the props gump, and where parsed constants its own way (#2624) 2026-09-10 19:36:30 -07:00
Engines test: stop the 1 ms promotion window leaking out of StepCacheLifecycleTests (#2679) 2026-09-25 00:55:07 -07:00
Gumps fix: TextDefinition was uneditable in the props gump, and where parsed constants its own way (#2624) 2026-09-10 19:36:30 -07:00
Items fix: Stop treasure chest guardian spawn farming via stack splits (#2568) 2026-08-10 09:01:29 -07:00
Misc fix: player corpse notoriety ignores the owner's body at death (#2669) 2026-09-23 19:43:37 -07:00
Mobiles fix: a deleted character's followers, and familiars that never unregistered (#2675) 2026-09-24 23:01:40 -07:00
Multis fix: Removes side effects from locked down items, decaying houses, bracelet of binding, and builds (#2608) 2026-09-06 09:39:00 -07:00
Network feat: make the blocklist and manual allowlist opt-in; cut the ban subsystem's on-loop cost (#2577) 2026-08-13 23:22:35 -07:00
Skills feat(skills): SkillEvents.SkillUsed for cross-assembly subscribers; InternalsVisibleTo ModernSpawner.Tests (#2636) 2026-09-11 22:58:44 -07:00
Spells refactor: Changes BaseCreature to the SerializationGenerator (delta save requirement) (#2611) 2026-09-06 14:11:51 -07:00
Utilities fix(commands): parse and edit IPoint2D/IPoint3D properties (#2646) 2026-09-14 21:20:22 -07:00
WorldSaves fix: Removes side effects from locked down items, decaying houses, bracelet of binding, and builds (#2608) 2026-09-06 09:39:00 -07:00