Skip to content

Commit

Permalink
Merge pull request #5932 from edwintorok/private/edvint/sleepy
Browse files Browse the repository at this point in the history
CI: fix spurious failure on busy system
  • Loading branch information
edwintorok authored Aug 14, 2024
2 parents 42d0418 + 2b3a0a6 commit aae22a0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ocaml/libs/clock/test_timer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ let test_timer_remaining =
(not (Timer.span_is_shorter Mtime.Span.(2 * actual) ~than:duration)) ;
let () =
match Timer.remaining timer with
| Expired _ when half < 0.05 ->
(* OS timer may not be accurate for very short sleeps,
or the system might be busy.
Skip the strict test on very short durations, we'll still test this on the 100ms+ ones.
*)
()
| Expired t ->
Test.fail_reportf
"Expected to have spare time, but got excess: %a. Duration: %a, \
Expand Down

0 comments on commit aae22a0

Please sign in to comment.