Skip to content

Commit

Permalink
Skip CLOCK_UPTIME_RAW_APPROX since it seems less precise than adverti…
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Apr 28, 2019
1 parent 2083499 commit 1090192
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/process/clock_getres_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# The clock should not be less accurate than reported (times should
# not all be a multiple of the next precision up, assuming precisions
# are multiples of ten.)
times.select { |t| t % (reported * 10) == 0 }.size.should_not == times.size
times.select { |t| t % (reported * 10) == 0 }.size.should_not == times.size
end
end
end
Expand Down
7 changes: 7 additions & 0 deletions core/process/fixtures/clocks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ def self.clock_constants_for_resolution_checks
}
end

# These clocks in practice on macOS seem to be less precise than advertised by clock_getres
platform_is :darwin do
clocks = clocks.reject { |clock, value|
[:CLOCK_UPTIME_RAW_APPROX].include?(clock)
}
end

# These clocks in practice on ARM on Linux do not seem to match their reported resolution.
platform_is :armv7l, :aarch64 do
clocks = clocks.reject { |clock, value|
Expand Down

0 comments on commit 1090192

Please sign in to comment.