Skip to content

[9.5] [ML] Make CMonotonicTimeTest robust to sleep overshoot on CI (#3201) - #3206

Merged
elastic-vault-github-plugin-prod[bot] merged 1 commit into
9.5from
backport/9.5/pr-3201
Sep 21, 2026
Merged

elastic-vault-github-plugin-prod[bot] merged 1 commit into
9.5from
backport/9.5/pr-3201

Conversation

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 9.5:

Questions ?

Please refer to the Backport tool documentation

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)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated approval: clean backport of an already-reviewed change. Auto-merge is armed and will merge once the required CI checks are green.

@elastic-vault-github-plugin-prod
elastic-vault-github-plugin-prod Bot merged commit 6fb0043 into 9.5 Sep 21, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically merge backport PRs when CI passes backport :ml >test v9.5.5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants