diff options
-rw-r--r-- | spec/ruby/core/process/clock_getres_spec.rb | 7 | ||||
-rw-r--r-- | spec/ruby/core/process/fixtures/clocks.rb | 8 |
2 files changed, 9 insertions, 6 deletions
diff --git a/spec/ruby/core/process/clock_getres_spec.rb b/spec/ruby/core/process/clock_getres_spec.rb index d95272f6c7..0fc2a958b3 100644 --- a/spec/ruby/core/process/clock_getres_spec.rb +++ b/spec/ruby/core/process/clock_getres_spec.rb @@ -24,12 +24,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.) - - if name != :CLOCK_MONOTONIC_RAW - # On a Hyper-V Linux guest machine, CLOCK_MONOTONIC_RAW can violate - # this assertion. So skipping this test for CLOCK_MONOTONIC_RAW. - times.select { |t| t % (reported * 10) == 0 }.size.should_not == times.size - end + 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 f59a9562ec..cd75b8a772 100644 --- a/spec/ruby/core/process/fixtures/clocks.rb +++ b/spec/ruby/core/process/fixtures/clocks.rb @@ -47,6 +47,14 @@ module ProcessSpecs } end + # On a Hyper-V Linux guest machine, these clocks in practice + # seem to be less precise than advertised by clock_getres + platform_is :linux do + clocks = clocks.reject { |clock, value| + clock == :CLOCK_MONOTONIC_RAW + } + end + clocks end end |