Skip to content

Tests: make the session tests independent of WSL wall-clock steps (#296) - #300

Merged
pjerra merged 1 commit into
devfrom
fix/ta296-flaky-tests
Oct 23, 2026
Merged

pjerra merged 1 commit into
devfrom
fix/ta296-flaky-tests

Conversation

@pjerra

@pjerra pjerra commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Part of #296 (the four session test flakes).

Cause: the WSL2 host steps its wall clock back about 2.2 s every ~30 s; the session slews its movement client time toward the wall clock and captures are stamped with it, and some harness waits (2 s) were shorter than a real walk leg.

Fix (tests and harness only): session tests run on a monotonic-driven clock (steadyClock), waits for packets/Ready/Run exit use a 15 s bound that ends on arrival, and the live replay scenario re-runs (up to 5 times) when monotonic and wall elapsed time differ by more than 50 ms. No assertion or bound changed.

Results: TestReplayEqualsLiveEvents 3/50 -> 0/200, TestWalkPathKeepsToTheGround 3/50 -> 0/200, TestFeatherFallMidFlight 2/50 -> 0/200, TestWalkPathCountsAlongThePathWhenRootedAfterACorner 3/50 -> 0/200 (all -race).
Reviews: Codex review clean; cold review SHIP (20 x -race iterations green).

Still open on #296: the GM-line threading test caught a real selection race; its fix is a separate branch.

…rom failing walk, flight and replay tests (#296)

The WSL2 host steps its wall clock back about 2 s every 30 s. The session slews its movement
time towards the wall clock, so a step during a walk or flight slows the client time for
seconds (walk tests timed out at 2 s, FeatherFallMidFlight saw a step 0.03 yd over its
bound), and the capture stamps records with the wall clock, so a step put records before
earlier ones and the replay missed the knockback landing (17 decoded, 18 live).

- harness: sessions run on a steady clock (monotonic-driven clockFn); packet, ready and
  condition waits are 15 s instead of 2 s (they end on arrival)
- replay tests: the live scenario runs again when the wall clock stepped during it
- no product code changed
@pjerra
pjerra merged commit 070124e into dev Oct 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant