summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/ruby/core/process/clock_getres_spec.rb2
-rw-r--r--spec/ruby/core/process/fixtures/clocks.rb7
2 files changed, 8 insertions, 1 deletions
diff --git a/spec/ruby/core/process/clock_getres_spec.rb b/spec/ruby/core/process/clock_getres_spec.rb
index c745902fd8..b6353fea64 100644
--- a/spec/ruby/core/process/clock_getres_spec.rb
+++ b/spec/ruby/core/process/clock_getres_spec.rb
@@ -27,7 +27,7 @@ describe "Process.clock_getres" do
# 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
diff --git a/spec/ruby/core/process/fixtures/clocks.rb b/spec/ruby/core/process/fixtures/clocks.rb
index e3f531944d..c04ae7785f 100644
--- a/spec/ruby/core/process/fixtures/clocks.rb
+++ b/spec/ruby/core/process/fixtures/clocks.rb
@@ -26,6 +26,13 @@ module ProcessSpecs
}
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|