Repository navigation
Tests: make the session tests independent of WSL wall-clock steps (#296) - #300
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.