[9.5] [ML] Make CMonotonicTimeTest robust to sleep overshoot on CI (#3201) - #3206
Merged
Merged
Conversation
The millisecond and nanosecond timer tests slept for one second and then asserted the monotonic timer had advanced by a value within a fixed [900, 1200]ms window. This really tested the accuracy of sleep_for rather than the timer: on oversubscribed CI machines (e.g. the macOS Orka VMs) the sleep can overshoot substantially, which intermittently pushed the measured interval past the 1200ms upper bound and failed the build. Measure the elapsed interval independently with std::chrono::steady_clock around the same sleep and assert the monotonic timer agrees with that reference to within 5%. This validates what we actually care about - that the timer tracks real elapsed time - and is immune to how long the machine actually slept for. (cherry picked from commit d6a62eb)
3 tasks
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.
Backport
This will backport the following commits from
mainto9.5:Questions ?
Please refer to the Backport tool documentation